亲测不闪 Component({ data: { selected: -1, // 这里不让默认选中 color: "#7A7E83", selectedColor: "#3cc51f", list: [{ pagePath: "/index/index", iconPath: "/image/icon_component.png", selectedIconPath: "/image/icon_component_HL.png", text: "组件" }, { pagePath: "/index/index2", iconPath: "/image/icon_API.png", selectedIconPath: "/image/icon_API_HL.png", text: "接口" }] }, attached() { }, methods: { switchTab(e) { const data = e.currentTarget.dataset const url = data.path wx.switchTab({url}) // 这里注释掉 // this.setData({ // selected: data.index // }) } } })
自定义tabbar切换时图标闪烁问题使用官方的自定义tabbar demo,两个tabbar测试无异常,新增多两个tabbar切换时就会出现明显的图标闪烁
2020-09-01