看到小程序开发论坛里讨论的问题,我这也碰到了,无法覆盖tab-bar层级,怎么办?

解决方案:使用if 控制隐藏/展示 tabbar

1.在自定义custom-tab-bar组件 index.js中添加 show 属性

data: {
  show:true
}

2.在index.wxml中添加if语句

<view class="custom-tab" wx:if="{{show}}">
   中间内容省略
</view>

3.在需要使用dialog前调用--隐藏tabbar

this.getTabBar().setData({
  show: false,
});

4.在关闭dialog后 调用--显示tabbar

this.getTabBar().setData({
  show: true,
});

相关文章:

  • 2021-11-14
  • 2022-12-23
  • 2021-11-28
  • 2018-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-08-22
猜你喜欢
  • 2021-05-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
相关资源
相似解决方案