This commit is contained in:
张良(004796)
2024-03-28 19:02:09 +08:00
parent b38001e0de
commit 7a91ff212a
3 changed files with 28 additions and 7 deletions

View File

@@ -13,31 +13,41 @@ const routes = [
{
path: '/anti/fraud',
name: 'antiFraud',
title: "防骗指南",
meta: {
title: "防骗指南",
},
component: () => import(/* webpackChunkName: "about" */ '../views/AntiFraud.vue')
},
{
path: '/agreement/anchor-join',
name: 'anchorJoinAgreement',
title: "主播入驻协议",
meta: {
title: "主播入驻协议",
},
component: () => import(/* webpackChunkName: "about" */ '../views/AnchorJoinAgreement.vue')
},
{
path: '/agreement/privacy',
name: 'privacyAgreement',
title: "隐私协议",
meta: {
title: "隐私协议",
},
component: () => import(/* webpackChunkName: "about" */ '../views/PrivacyAgreement.vue')
},
{
path: '/agreement/user',
name: 'userAgreement',
title: "用户协议",
meta: {
title: "用户协议",
},
component: () => import(/* webpackChunkName: "about" */ '../views/UserAgreement.vue')
},
{
path: '/share',
name: 'share',
title: "分享",
meta: {
title: "分享",
},
component: () => import(/* webpackChunkName: "about" */ '../views/Share.vue')
},
{
@@ -54,4 +64,15 @@ const router = new VueRouter({
routes
})
router.beforeEach((to, from, next) => {
//beforeEach是router的钩子函数在进入路由前执行
if (to.meta.title) {
//判断是否有标题
document.title = to.meta.title
} else {
document.title = '恋香'
}
next()
})
export default router