feature: change page title when route change (#1910)

This commit is contained in:
非空
2019-04-15 11:58:43 +08:00
committed by 花裤衩
parent 14580da5b3
commit 26d0f40df2
6 changed files with 37 additions and 10 deletions

View File

@@ -0,0 +1,13 @@
import defaultSettings from '@/settings'
import i18n from '@/lang'
const title = defaultSettings.title || 'Vue Element Admin'
export default function getPageTitle(key) {
const hasKey = i18n.te(`route.${key}`)
if (hasKey) {
const pageName = i18n.t(`route.${key}`)
return `${pageName} - ${title}`
}
return `${title}`
}