We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
官方示例中的vue写法存在内存泄漏
官方示例
data() { return { + leak: new Array(5 * 1024 * 1024), dialogVisible: false, }; },
开启无痕模式进行内存记录,然后不断的切换不同的子项目
结果显示vue的实例并没有释放
虽然qiankun代码中会删除这些vue实例的html节点,但是不知道什么原因�这些html对应的内存并没有释放
通过在unmount中设置清除html节点可解决此问题
export async function unmount() { instance.$destroy(); + instance.$el.innerHTML = ""; instance = null; router = null; }
参考: https://github.com/single-spa/single-spa-vue/blob/adc35a667b18ea8acd87b352739d78b771cddb38/src/single-spa-vue.js#L145
The text was updated successfully, but these errors were encountered:
#675
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
What happens?
官方示例中的vue写法存在内存泄漏
Mini Showcase Repository(REQUIRED)
官方示例
How To Reproduce
data() { return { + leak: new Array(5 * 1024 * 1024), dialogVisible: false, }; },
开启无痕模式进行内存记录,然后不断的切换不同的子项目
结果显示vue的实例并没有释放
解决方式
虽然qiankun代码中会删除这些vue实例的html节点,但是不知道什么原因�这些html对应的内存并没有释放
通过在unmount中设置清除html节点可解决此问题
export async function unmount() { instance.$destroy(); + instance.$el.innerHTML = ""; instance = null; router = null; }
参考: https://github.com/single-spa/single-spa-vue/blob/adc35a667b18ea8acd87b352739d78b771cddb38/src/single-spa-vue.js#L145
Context
The text was updated successfully, but these errors were encountered: