Files
arakrail/middleware/routerGuards.js
T
2020-11-14 12:37:59 +03:30

18 lines
497 B
JavaScript

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'})
}
})
}
}