底部導(dǎo)航在一級(jí)頁(yè)面顯示夺刑,二級(jí)頁(yè)面不顯示
在router>index.js中增加meta屬性
routes: [
{
path: '/',
name: 'home',
component: Home,
//是否開(kāi)啟底部導(dǎo)航
meta:{
//路由層級(jí),數(shù)值越大層級(jí)越深愧驱,以此決定轉(zhuǎn)場(chǎng)動(dòng)畫(huà)的前進(jìn)和后退 大于前進(jìn),小于后退
index:0,
showFooter:true
}
},
{
path: '/competition',
name: 'competition',
component: Competition,
meta:{
index:0,
showFooter:true
}
},
//二級(jí)頁(yè)面
{
path: '/navChannel',
name: 'navChannel',
component: NavChannel,
meta:{
index:1,
showFooter:false
}
}
在app.vue引入: <Tabbar v-show="$route.meta.showFooter"></Tabbar>