uniapp switchTab页面跳转刷新

//编写App


//页面A
uni.switchTab({
			 url: '/pages/index/index',
			success: function (e) {
					var page = getCurrentPages()[0]
					if (page == undefined || page == null) return;
						 page.navigateHandle(); 
				 }
		});
//页面B
navigateHandle:function(){
//你要调用的数据
}

//编写小程序

  uni.switchTab({
            url: "../library/library?topIndex=1&subIndex=3",
            success: (res) => {
                                                        console.log('跳转成功',res)
                                                        let data={
                                                            topIndex:1,
                                                            subIndex:3
                                                        }
                                                        let page = getCurrentPages().pop();
                                                        if (page == undefined || page == null) return;
 //data 可传可不传值                                                 page.onLoad(data);
                                                    },
                                                    fail: (err) => {
                                                        console.log('跳转失败',err)
                                                    }
                                                })

你可能感兴趣的:(uniapp switchTab页面跳转刷新)