第一步:配置src\router\index.js
代码:
{
path: '/goodsList/Goods_Index',
name: 'Goods_Index',
component: GoodsIndex,
meta:{
title:'商品中心'
}
},//商品列表页面
第二步:配置src\main.js
代码:
import router from './router'
router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面title */
if (to.meta.title) {
document.title = to.meta.title
}
next()
})
THE END