add header and lang switcher

This commit is contained in:
Amir Mohamadi
2020-06-04 13:12:48 +04:30
parent 75f8971cb3
commit 471e982b18
9 changed files with 216 additions and 52 deletions
+17
View File
@@ -0,0 +1,17 @@
export default function (ctx) {
if (ctx.app.store.state.global.navigation_guard) {
ctx.app.store.commit('global/navigationGuards', false)
/////////////////////////////////// beforeEach
////////////////////////////////// afterEach
ctx.app.router.afterEach((to, from) => {
if (to.params.lang === 'fa') {
$('html').attr({lang: 'fa'})
} else if (to.params.lang === 'en') {
$('html').attr({lang: 'en'})
}
})
}
}