//1.报错情况
//分包地址
let str = "/epermarketSub/NewType?ProductCataID=604"
uni.reLaunch({
url:str,
fail(err) {
console.log(err);
//当前页面在/pages/Authorization/目录下此时报错信息如下
//errMsg: "reLaunch:fail page `/pages/Authorization/ /epermarketSub/NewType?ProductCataID=604` is not found"
}
});
//2.正常可跳转情况
uni.reLaunch({
url:"/epermarketSub/NewType?ProductCataID=604" //或使用“../../epermarketSub/NewType?ProductCataID=604”也可正常跳转,
fail(err) {
console.log(err);
}
});
//如何解决使用变量也可跳转?

1***@qq.com
- 发布:2024-03-15 09:58
- 更新:2024-03-15 10:52
- 阅读:261
1***@qq.com (作者)
不行的 分包完整地址是“/epermarketSub/NewType?ProductCataID=604”,他相当于是在主包目录下找分包的位置 所以肯定是报错的 但是我url填写的是分包的路径 很奇怪
2024-03-15 10:54
套马杆的套子
回复 1***@qq.com: 看下你的subPackages
2024-03-15 11:24