解决自定义tabbar切换时会闪烁的问题
发布于 2 年前 作者 yanye 1251 次浏览 来自 分享

主要看上面的图,如果还是解决不了,将下面的代码复制一下

Component({
  data: {
    selected: 0,//这个必须设置为0
    "color""#999999",
    "selectedColor""#333333",
    "backgroundColor":"#ffffff",
    "borderStyle":"white",
    "list": []
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path;
      wx.switchTab({url})
    }
  }
})
回到顶部