uniapp跳转无效的解决办法:如果要跳转的路径在pages.json里面的tabbar,需要使用【uni.switchtab】进行跳转,代码为【let page = getcurrentpages().pop();】。
本教程操作环境:windows7系统、uni-app2.5.1版本,该方法适用于所有品牌电脑。
推荐(免费):uni-app开发教程
uniapp跳转无效的解决办法:
在一个接口里面使用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(); //如果页面存在,则重新刷新页面 } });
相关免费学习推荐:php编程(视频)
以上就是uniapp跳转无效怎么办的详细内容。