Skip to content
Snippets Groups Projects
Commit b956be5a authored by Henrik Askjer's avatar Henrik Askjer
Browse files

track return routing in vuex

parent 94883567
No related branches found
No related tags found
No related merge requests found
...@@ -93,6 +93,12 @@ const store = new Vuex.Store({ ...@@ -93,6 +93,12 @@ const store = new Vuex.Store({
currentLocale: null, currentLocale: null,
collapseArticles: null, collapseArticles: null,
menuOpen: false, menuOpen: false,
searchRoute: null,
dictRoute: null,
article: null
}, },
mutations: { mutations: {
initStore(state) { initStore(state) {
...@@ -132,19 +138,27 @@ const store = new Vuex.Store({ ...@@ -132,19 +138,27 @@ const store = new Vuex.Store({
localStorage.removeItem("currentLocale") localStorage.removeItem("currentLocale")
localStorage.removeItem("collapseArticles") localStorage.removeItem("collapseArticles")
this.commit("initStore") this.commit("initStore")
},
setSearchRoute(state, path) {
state.searchRoute = path
},
setDictRoute(state, path) {
state.dictRoute = path
},
setArticle(state, article) {
state.article = article
} }
} }
}) })
/*
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log("to", to) if (to.name == 'about') {
console.log("from", from) store.commit('setDictRoute', from.fullPath)
}
next() next()
}) })
*/
new Vue({ new Vue({
router, router,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment