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

[Feature Request] 能否提供彻底卸载loadMicroApp加载的子应用,下次进入能重新走首次流程 #2166

Closed
czwaiwai opened this issue Jun 29, 2022 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@czwaiwai
Copy link

Background

生产可能已经发布了新的子应用,但是用户由于已加载过子应用,导致无法获取到更新后的子应用
且子应用在部分js应网络问题加载失败后,无法通过再次加载子应用来提供访问重试的方案

Proposal

建议提供彻底卸载方法来移除已加载过的子应用,能让子应用像首次加载子应用一样的流程

@kuaifengle
Copy link

每个加载完毕的微应用 都有生命周期函数可以执行

image

销毁的函数: unmount()

// 加载微应用
 let microApp = loadMicroApp({})

// 销毁微应用
microApp.unmount()

@XSnowHoly
Copy link

每个加载完毕的微应用 都有生命周期函数可以执行

image

销毁的函数: unmount()

// 加载微应用
 let microApp = loadMicroApp({})

// 销毁微应用
microApp.unmount()

如果因为网络问题没有加载成功微应用如何重试?

@kuaifengle
Copy link

可以先查询微应用是否加载成功 再确定是否需要卸载

     if (microApp.getStatus() == 'MOUNTED') {
                   microApp.unmount()
             }

@kuitos kuitos added the bug Something isn't working label Mar 5, 2024
@kuitos kuitos added this to the 3.0 milestone Mar 5, 2024
@kuitos kuitos closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants