meta 路由元元素
meta中key-value都是自定义的
import { createRouter,createWebHistory } from 'vue-router'
export let constom = [
{
path:'/',
name:"Home",
component:()=>import('@/page/Home/index.vue'),
// meta 路由元元素
// meta中key-value都是自定义的
meta:{
title: "首页"
}
}, {
path:'/shopcar',
name:"ShopCar",
component:()=>import('@/page/ShopCar/index.vue'),
meta:{
title:'购物车'
}
}, {
path:'/mine',
name:"Mine",
component:()=>import('@/page/Mine/index.vue'),
meta:{
title:'个人中心'
}
}
]
let router = createRouter({
history:createWebHistory(),
routes:constom,
linkActiveClass: 'router-active', // 自定义被激活路由的class类名 默认名router-link-active
linkExac