路由元信息的使用
配置路由的时候,可以给路由添加路由元信息meta
举例:让组件Footer在Home和Search中展示,登录注册时隐藏
路由配置
//配置路由 export default new VueRouter({ routes:[ { path:'*', redirect: '/home' }, { path: '/home', component: Home, meta:{ showFooter: true } }, { path: '/search', component: Search, meta:{ showFooter: true } }, { path: '/login', component: Login }, { path: '/register', component: Register } ] })