//1. Customize tabbar //2. Customize tabbar //2. There is a bug when the tabbar selects the page that is not consistent with the switch

// The following is the solution to the above bug. Use it on the page that uses the component, not directly on the component page

// small program writing

pageLifetimes: {

show() {
  this.getTabBar().setData({  
       selected: 1
  })  
},

},

// Uni onPageHow, onPageHide, onPageResize are the show, hide, and resize of PageLifeTimes in the applet

onPageShow: function() {

    const page = this.$mp.page  
    if (typeof page.getTabBar === 'function' &&  
           page.getTabBar()) {  
           page.getTabBar().setData({  
                selected: 1
          })  
    }

},