美文网首页
2018-12-10

2018-12-10

作者: AlpsWang | 来源:发表于2018-12-11 00:12 被阅读0次

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

    在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>
    
    

    相关文章

      网友评论

          本文标题:2018-12-10

          本文链接:https://www.haomeiwen.com/subject/bzzrhqtx.html