小程序自定义tabbar里的js索引代码会影响数据读不到和swiper报错

发布于 7 年前作者 yangming7504 次浏览最后编辑 7 年前来自 issues

/*//自定义tabbar

Component({

pageLifetimes: {

show() {

if (typeof this.getTabBar === ‘function’ &&

this.getTabBar()) {

this.getTabBar().setData({

selected: 0

})

}

}

}

})*/

加上如上代码就会读不到数据 报错禁掉就可以

1 回复
mingzou
mingzou1 楼5 年前