From 83c645c2fb97124118da9e1e6391622d9cc8d7cb Mon Sep 17 00:00:00 2001 From: buttle Date: Tue, 15 Mar 2022 22:45:28 +0100 Subject: [PATCH] appends hashtag + search_text to browser's url --- src/components/search.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/search.vue b/src/components/search.vue index f0ac128..56daa9b 100644 --- a/src/components/search.vue +++ b/src/components/search.vue @@ -43,8 +43,11 @@ export default { }, methods: { search: function() { - console.log('searching for: '+this.search_text) - var self = this + //console.log('searching for: '+this.search_text) + const uri = window.location.toString() + const withNoHash = uri.substring(0, uri.indexOf('#')) + //console.log('setting hash') + window.history.replaceState({}, document.title, withNoHash+'#'+this.search_text) this.setSearchText(this.search_text) this.siteSearch() },