配置路由的时候,可以给路由添加路由元信息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 } ] })
标签:Search,home,component,信息,meta,使用,path,路由 From: https://www.cnblogs.com/ixtao/p/17230557.html