瀏覽代碼

fix(tabbar): 修复微信小程序平台下原生tabbar隐藏问题

添加条件编译指令,仅在非微信小程序平台执行原生tabbar隐藏逻辑
feige996 8 月之前
父節點
當前提交
ca2b7452c8
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/tabbar/index.vue

+ 3 - 0
src/tabbar/index.vue

@@ -38,6 +38,8 @@ function handleClick(index: number) {
     uni.navigateTo({ url })
   }
 }
+// #ifndef MP-WEIXIN
+// 因为有了 custom:true, 微信里面不需要多余的hide操作
 onLoad(() => {
   // 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题
   needHideNativeTabbar
@@ -50,6 +52,7 @@ onLoad(() => {
     },
   })
 })
+// #endif
 const activeColor = 'var(--wot-color-theme, #1890ff)'
 const inactiveColor = '#666'
 function getColorByIndex(index: number) {