From edbe89b8971610a3a1a1effa5abfa7db9f209775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Volds=C3=A6ter?= <ole.voldsater@uib.no> Date: Fri, 21 Feb 2020 10:34:58 +0100 Subject: [PATCH] bruk "lang" i url som pushes --- src/App.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 4959e79..417f1c4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -79,7 +79,7 @@ export default { if(event._source){ this.search_results = [] this.article = event._source - history.pushState(this.article, '', event._id) + history.pushState(this.article, '', '/' + this.lang + '/' + event._id) }else{ window.location.href = '/' + this.lang + "/search?q=" + event.q } @@ -106,6 +106,11 @@ export default { else { this.waiting = false } + }, + watch: { + $route(to, from) { + this.lang = this.$route.params.lang || 'nob' + } } } </script> -- GitLab