设置各个页面标题

This commit is contained in:
zhcnyuyang 2025-05-02 19:58:27 +08:00
parent 0f5d536c21
commit 50616c9100
2 changed files with 24 additions and 6 deletions

View File

@ -29,11 +29,13 @@ export default {
@include media-breakpoint-between(xs, md) {
min-height:806px;
background-image: url('/bottom/bg_wep.png');
}
@include media-breakpoint-up(md) {
min-height: 759px;
margin-top: 0px;
background-image: url('/bottom/bg_pc.png');
}
}
</style>

View File

@ -4,32 +4,38 @@ const routes= [
{
path: '/',
name: 'Homepage',
component: ()=>import('./components/Homepage.vue')
component: ()=>import('./components/Homepage.vue'),
meta: { title: '首页-开动文化科技(北京)有限公司' }
},
{
path: '/ContactUs',
name: 'ContactUs',
component: ()=>import('./components/ContactUs.vue')
component: ()=>import('./components/ContactUs.vue'),
meta: { title: '联系我们-开动文化科技(北京)有限公司' }
},
{
path: '/Aboutus',
name: 'Aboutus',
component: ()=>import('./components/Aboutus.vue')
component: ()=>import('./components/Aboutus.vue'),
meta: { title: '关于我们-开动文化科技(北京)有限公司' }
},
{
path: '/ServiceProcess',
name: 'ServiceProcess',
component: ()=>import('./components/ServiceProcess.vue')
component: ()=>import('./components/ServiceProcess.vue'),
meta: { title: '服务流程-开动文化科技(北京)有限公司' }
},
{
path: '/Examples',
name: 'Examples',
component: ()=>import('./components/Examples.vue')
component: ()=>import('./components/Examples.vue'),
meta: { title: '行业案例-开动文化科技(北京)有限公司' }
},
{
path: '/Err404',
name: 'Err404',
component: ()=>import('./components/Tools/Err404.vue')
component: ()=>import('./components/Tools/Err404.vue'),
meta: { title: '404未找到此页面' }
},
{
path: '/:pathMatch(.*)*',
@ -42,4 +48,14 @@ const router = createRouter({
routes
})
// 路由守卫,切换页面时修改标题
router.beforeEach((to, from, next) => {
if (to.meta && to.meta.title) {
document.title = to.meta.title
} else {
document.title = '开动文化科技(北京)有限公司'
}
next()
})
export default router