Page({ /** * 页面的初始数据 */ data: {}, /** * 生命周期函数--监听页面加载 */ onShow() { if (typeof this.getTabBar === 'function') { this.getTabBar().setData({ selected: 1 }) } }, })