vux-ui 用了tabbar后怎么使用全屏组件

问题

项目用了vux-ui ,使用tabbar 来导航。 后来在子路由里面使用全屏组件发现组件fixed 层级设置再怎么高,都无法覆盖住tabbar ,请问如何解决?

代码

<template>
  <div id="app" style="height: 100%">
    <drawer>
      <view-box>
        <keep-alive>
          <router-view></router-view>
        </keep-alive>
      </view-box>
    </drawer>
    <tabbar>
      <tabbar-item link="/index" :selected="$route.path == '/index'">
        <span slot="icon" class="iconfont icon-home"></span>
        <span slot="label">首页</span>
      </tabbar-item>
      <tabbar-item link="/storeCenter" :selected="$route.path == '/storeCenter'">
        <span slot="icon" class="iconfont icon-store"></span>
        <span slot="label">门店</span>
      </tabbar-item>
      <tabbar-item link="/explore" :selected="$route.path == '/explore'">
        <span slot="icon" class="iconfont icon-search"></span>
        <span slot="label">发现</span>
      </tabbar-item>
      <tabbar-item show-dot link="/me" :selected="$route.path == '/me'">
        <span slot="icon" class="iconfont icon-wode"></span>
        <span slot="label">我的</span>
      </tabbar-item>
    </tabbar>
  </div>
</template>

截图

图片描述

阅读 5.9k
3 个回答

直接tabbar控件用一个控制变量来显示隐藏。
`<tabbar class="vux-demo-tabbar" icon-class="vux-center" v-show="!isTabbarDemo" slot="bottom">

      <tabbar-item :link="{path:'/'}" :selected="route.path === '/'">
        <span class="demo-icon-22 vux-demo-tabbar-icon-home" slot="icon" style="position:relative;top: -2px;">&#xe637;</span>
        <span slot="label">Home</span>
      </tabbar-item>
      <tabbar-item :link="{path:'/demo'}" :selected="isDemo" badge="9">
        <span class="demo-icon-22" slot="icon">&#xe633;</span>
        <span slot="label"><span v-if="componentName" class="vux-demo-tabbar-component">{{componentName}}</span><span v-else>Demos</span></span>
      </tabbar-item>
      <tabbar-item :link="{path:'/project/donate'}" :selected="route.path === '/project/donate'" show-dot>
        <span class="demo-icon-22" slot="icon">&#xe630;</span>
        <span slot="label">Donate</span>
      </tabbar-item>
    </tabbar>`

||判断测试可以

<tabbar v-show="$route.path == '/index' || $route.path == '/storeCenter' || $route.path == '/explore' || $route.path == '/me'" slot="bottom">
      <tabbar-item link="/index" :selected="$route.path == '/index'">
        <span slot="icon" class="iconfont icon-home"></span>
        <span slot="label">首页</span>
      </tabbar-item>
      <tabbar-item link="/storeCenter" :selected="$route.path == '/storeCenter'">
        <span slot="icon" class="iconfont icon-store"></span>
        <span slot="label">门店</span>
      </tabbar-item>
      <tabbar-item link="/explore" :selected="$route.path == '/explore'">
        <span slot="icon" class="iconfont icon-search"></span>
        <span slot="label">发现</span>
      </tabbar-item>
      <tabbar-item show-dot link="/me" :selected="$route.path == '/me'">
        <span slot="icon" class="iconfont icon-wode"></span>
        <span slot="label">我的</span>
      </tabbar-item>
    </tabbar>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题