fix[i18n]: Change title when switching language
This commit is contained in:
parent
f55dd06f5a
commit
416177cf6b
|
@ -1,5 +1,7 @@
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
import { getLanguage } from '@/lang/index'
|
import { getLanguage } from '@/lang/index'
|
||||||
|
import router from '@/router'
|
||||||
|
import getPageTitle from '@/utils/get-page-title'
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
sidebar: {
|
sidebar: {
|
||||||
|
@ -30,6 +32,7 @@ const mutations = {
|
||||||
state.device = device
|
state.device = device
|
||||||
},
|
},
|
||||||
SET_LANGUAGE: (state, language) => {
|
SET_LANGUAGE: (state, language) => {
|
||||||
|
document.title = getPageTitle(router.currentRoute.meta.title)
|
||||||
state.language = language
|
state.language = language
|
||||||
Cookies.set('language', language)
|
Cookies.set('language', language)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue