From 416177cf6bb2025c1c08f7c6f951314552ba0537 Mon Sep 17 00:00:00 2001 From: albert Date: Thu, 3 Sep 2020 10:36:29 +0800 Subject: [PATCH] fix[i18n]: Change title when switching language --- src/store/modules/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 73616469..a3ff8166 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -1,5 +1,7 @@ import Cookies from 'js-cookie' import { getLanguage } from '@/lang/index' +import router from '@/router' +import getPageTitle from '@/utils/get-page-title' const state = { sidebar: { @@ -30,6 +32,7 @@ const mutations = { state.device = device }, SET_LANGUAGE: (state, language) => { + document.title = getPageTitle(router.currentRoute.meta.title) state.language = language Cookies.set('language', language) },