2018-12-10

底部导航在一级页面显示,二级页面不显示

在router>index.js中增加meta属性
routes: [
  {
    path: '/',
    name: 'home',
    component: Home,
//是否开启底部导航
    meta:{
//路由层级,数值越大层级越深,以此决定转场动画的前进和后退 大于前进,小于后退
      index:0,
      showFooter:true
    }
  },
  {
    path: '/competition',
    name: 'competition',
    component: Competition,
    meta:{
      index:0,
      showFooter:true
    }
  },
//二级页面
{
    path: '/navChannel',
    name: 'navChannel',
    component: NavChannel,
    meta:{
      index:1,
      showFooter:false
    }
  }

在app.vue引入: <Tabbar v-show="$route.meta.showFooter"></Tabbar>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容