diff --git a/src/App.vue b/src/App.vue index 507df7af56ffec036af0591ab3e5242ae9e3a399..37e139412a784ef07684667911b8af56323a4ad1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -188,7 +188,7 @@ export default { }else{ this.waiting_for_articles = true this.article = {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}} - this.$router.push(`/search?q=${event.q}&lang=${this.lang}`) + this.$router.push(`/${this.lang}/search/${event.q}`) navigate_to_search(this, event.q) } }, @@ -219,13 +219,15 @@ export default { ]).then(function(_) { self.waiting_for_metadata = false if(self.$route.name == 'word') { + self.lang = self.$route.params.lang navigate_to_word(self, self.$route.params.word) } else if(self.$route.name == 'lookup'){ navigate_to_article(self, self.$route.params.id) } else if (self.$route.name == 'search') { - navigate_to_search(self, self.$route.query.q) + self.lang = self.$route.params.lang + navigate_to_search(self, self.$route.params.query) } else { self.waiting_for_articles = false diff --git a/src/main.js b/src/main.js index 64591997e9f80b6103f6e9159227630bfa1af3f7..3c1f5c8c1282e429ad5562bae67286a46a86ddae 100644 --- a/src/main.js +++ b/src/main.js @@ -30,7 +30,7 @@ const router = new VueRouter({ props: true }, // Pass route.params to props { name: 'search', - path: '/search', + path: '/:lang/search/:query', component: App, props: true} ]