uni-app子页面跳转tabber页面不走onshow的解决

uni-app跳转tabber页面只能使用switchtab跳转,但是会发现进入后不走onshow生命周期,

解决:

子页面:

uni.switchTab({
url:'/pages/my/my',
success:function(){
let page = getCurrentPages()[0]
console.log(page)
page.$vm.requestAll()
}
})

 

tabber页面:

requestAll:function(){

//这里调用需要刷新的方法
console.log("fanhui")
this.xuan()
this.sbangding()
}

 

这个问题应该是框架的bug,官网提交bug说目前2.6.6测试版已经修复了,没更新正式版前就先用着吧

 

posted on 2020-03-23 14:13  万能的李大少  阅读(5195)  评论(0编辑  收藏  举报