uniapp 默认返回上一页 页面不刷新问题解决

3,127 阅读1分钟

请求之类的放到onLoad,created, mounted 中 ,回退时默认是不重新请求接口的, 如:

 onLoad(option){
   this.id=option.id;
   this.getDetailInfo();
 }

可以将所有请求放到,onShow中:

 onShow(){
   this.getDetailInfo();
 }

这样每次页面显示时就可以重新请求接口了。

原文链接:blog.csdn.net/weixin_4388…