微信小程序本来封装有底部导航栏,但对于想自定义样式和方法的开发者来说,这并不是很好。
参考链接:/ljybill/miniprogram-utils/tree/master/custom-tabbar
首先创建一个底部导航栏组件,名为:navBar
<view class= abbar><view wx:if={{_auth >= item.auth}} class= abbar-item wx:for={{tabbarList}} wx:key={{item.pagePath}} bindtap=handleItemTap data-path={{item.pagePath}} data-idx={{index}}><view class= abbar-item-icon><image src={{activeIdx === index ? item.selectedIconPath : item.iconPath}}></image></view><view class