提交 04bb9bf0 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

修复title不跟随参数变更的bug

上级 ed0b8496
......@@ -42,7 +42,7 @@ router.beforeEach(async(to, from, next) => {
handleKeepAlive(to)
const token = userStore.token
// 在白名单中的判断情况
document.title = getPageTitle(to.meta.title)
document.title = getPageTitle(to.meta.title, to)
if (whiteList.indexOf(to.name) > -1) {
if (token) {
if (!asyncRouterFlag && whiteList.indexOf(from.name) < 0) {
......
import { fmtTitle } from '@/utils/fmtRouterTitle'
import config from '@/core/config'
export default function getPageTitle(pageTitle) {
export default function getPageTitle(pageTitle, route) {
if (pageTitle) {
return `${pageTitle} - ${config.appName}`
const title = fmtTitle(pageTitle, route)
return `${title} - ${config.appName}`
}
return `${config.appName}`
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册