vue设置标题名字
const routes = [ { path: '/', name: 'home', component: () => import('../views/login.vue'), meta: { title: '登陆' } }] router.beforeEach((to, from, next) => { /* 路由发生变化修改页面title */ if (to.meta.title) { document.title = to.meta.title } next() })
路由设置网页标题