采用分包加载后, 分包的页面路径无法访问, 源代码如下:
app.json
{ "pages" : [ "pages/index/index" , "pages/logs/logs" , "pages/qrRecovery/qrRecovery" ], "subPackages" : [ { "root" : "walletPackage" , "pages" : [ "pages/walletInitial/walletInitial" ] } ], "window" : { "backgroundTextStyle" : "light" , "navigationBarBackgroundColor" : "#fff" , "navigationBarTitleText" : "WeChat" , "navigationBarTextStyle" : "black" } } |
项目文件结构:
链接发起文件 pages/index/index.wxml
< view > < navigator url = "../../walletPackage/walletInitial/walletInitial" hover-class = "navigator-hover" >跳转到新页面</ navigator > </ view > |
尝试过了各种组合:
../../walletPackage/walletInitial
../../walletPackage/pages/walletInitial
都提示无法找到页面
navigateTo:fail page "walletPackage/walletInitial/walletInitial" is not found |
网上也无法搜到类似问题,麻烦提点一下~
答案已找到,要写pages文件夹进路径里面,是自己马虎了:
<
view
>
<
navigator
url
=
"../../walletPackage/pages/walletInitial/walletInitial"
hover-class
=
"navigator-hover"
>跳转到新页面</
navigator
>
</
view
>