uni-app跳转遇到的问题
在一个接口里面使用uni.navigateTo进行跳转,但是跳转无反应
this.$request(this.$api['xxxx/xxxxxx'], this.journeyMessage, res =>{ uni.navigateTo({ url: '/pages/journey/journeyList' }); console.log('11111111111111') })
进行调式发现代码有被执行,但是无效果
最终参考网上大佬发现:
如果要跳转的路径在pages.json里面的tabBar里面跳转需要使用uni.switchTab进行跳转
但是使用uni.switchTab跳转不会刷新,
uni.switchTab({ url:'', success:(res)=> { let page = getCurrentPages().pop(); //跳转页面成功之后 if (!page) return; page.loadData(); //如果页面存在,则重新刷新页面 } });