// src/router/index.js
// 2.定义一些路由
const routes = [
{ path: "/", component: Index, name: "index", meta: {'title': '首页'} },
{ path: "/about", component: About, name: "about", meta: {'title': '关于'}},
{ path: "/login", component: Login, name: "login", meta: {'title': '登录'}},
{ path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound, meta: {'title': '404'} },
]
router.beforeEach(async (to, from, next) => {
// 设置页面标题
let title = (to.meta.title ? to.meta.title : "") + "~牛皮编程后台"
document.title = title
})