uni-app开发小程序-使用uni.switchTab跳转后页面不刷新的问题

 

uni.switchTab({
    url: '/pages/discover/discover',
    success: function(e) {
        var page = getCurrentPages().pop();
        if (page == undefined || page == null) return;
        page.onLoad();
    }
});

 

switchTab成功跳转后调用success,此时可以拿到跳转后页面的page对象,从而调用页面onLoad方法重载页面;微信后期应该会加相应的参数来决定是否刷新跳转

 

 

参考链接:https://www.jianshu.com/p/c95bdffe80bc

 

posted @ 2019-07-02 14:26  我若亦如风  阅读(9831)  评论(0)    收藏  举报