add 处理页面标题
This commit is contained in:
+5
-1
@@ -52,9 +52,13 @@ export default {
|
||||
},
|
||||
// 导航标题(国际化)
|
||||
pageTitle () {
|
||||
if (!this.$route.meta.pageTitle) {
|
||||
if (!this.$route.meta.pageTitle && !this.$route.meta.title) {
|
||||
return ''
|
||||
}
|
||||
// 路由守卫处理了把taskName赋值给title了
|
||||
if (this.$route.meta.title) {
|
||||
return this.$route.meta.title
|
||||
}
|
||||
return this.$t('pageTitle.' + this.$route.meta.pageTitle)
|
||||
},
|
||||
// 是否白色头部导航
|
||||
|
||||
@@ -26,6 +26,9 @@ router.beforeEach(async (to, from, next) => {
|
||||
if (to.path === '/user/login') {
|
||||
next('/')
|
||||
} else {
|
||||
if (to.query.taskName) {
|
||||
to.meta.title = to.query.taskName
|
||||
}
|
||||
next()
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user