Skip to content
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

vite的 主子应用 保活问题 #15

Closed
k983551019 opened this issue Jul 20, 2022 · 6 comments
Closed

vite的 主子应用 保活问题 #15

k983551019 opened this issue Jul 20, 2022 · 6 comments

Comments

@k983551019
Copy link

子应用 alive设置为true
切换页面时还是会进入到wujie的window.__WUJIE_MOUNT __WUJIE_UNMOUNT中,
如果不生命周期改造 还是会重新加载
就是保活并没有生效

@yiludege
Copy link
Collaborator

可以打印一下子应用的window.__WUJIE.alive,看看子应用是不是真的设置为保活了

@k983551019
Copy link
Author

可以打印一下子应用的window.__WUJIE.alive,看看子应用是不是真的设置为保活了

是false, 但是传值是true
image

@k983551019
Copy link
Author

image
image

@yiludege
Copy link
Collaborator

看你的代码似乎用了preloadApp预加载,假如你采用的是vue并且使用wujie-vue这样的封装,那么必须保证preloadApp和wujie-vue的alive都是true

从排查问题的角度,你可以先去除preloadApp预加载相关的逻辑,看看在没有预加载的场景下保活是不是正常

@yiludege
Copy link
Collaborator

可以看一下文档下面的警告:

name、replace、fetch、alive、degrade这五个参数在preloadApp和startApp中须保持严格一致,否则子应用的渲染可能出现异常

@k983551019
Copy link
Author

可以看一下文档下面的警告:

name、replace、fetch、alive、degrade这五个参数在preloadApp和startApp中须保持严格一致,否则子应用的渲染可能出现异常

解决了 感谢大佬 没注意看警告

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants