微信小程序 - 自定义tabBar组件,可动态设置、更新,无闪烁

2021-02-01  本文已影响0人  西半球_

demo 地址: https://github.com/iotjin/weapp-custom-tabbar

效果图:

image

tabbar图标闪烁的解决方案

1、将data中定义的selected赋值为null

在这里插入图片描述

2、删除切换tabbar时的selected赋值操作(在onShow方法中赋值)

在这里插入图片描述

实现步骤

1、custom-tab-bar导入项目根目录

2、app.json中设置"custom": true

3、在tabPage的onShow方法中调用更新方法

上一篇 下一篇

猜你喜欢

热点阅读