-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
支持分包配置么? #43
Comments
A({
config: {
route: ['/page/$page', '/pages/$page'],
resolvePath: function (name) {
return `/page/${name}`
}
}
}); |
A({
config: {
route: ['/pages/$page', '/packageA/pages/$page'],
resolvePath: function (name) {
return `/pages/${name}`
}
}
}); 我是按这样配置了,然后在pages/index要跳转到packageA的cat文件 this.$route('cat') 会提示 navigateTo:fail page "pages/cat" is not found |
有存在 |
在packageA下有,这样分包模式下,this.$route(pagename),要如何配置route才能打开packageA下的cat界面呢 |
resolvePath: function (name) {
if (isInPackageA(name)) {
return `/packageA/pages/${name}`
} else {
return `/pages/${name}`
}
} |
框架中有 isInPackageA 这个方法么?还是说需要自己实现 |
业务的判断逻辑,业务方才知道页面在哪个包下 |
只要不是pages目录下的page都可以看成是分包的 |
我也想问,要跳转的页面是分包,也不能预加载,这样就没办法注册一些生命周期例如onPreload,so是不是这种情况就没办法做预加载了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: