Comments (4)
自己debug了下,发现基座的MicroApp.vue组件销毁了,没有触发子应用的 vue实例销毁的生命周期(不知道是不是bug),自然子应用的路由影响还在。所以需要手动的销毁子应用的vue实例:
const subApp = new Vue({
router,
store,
render: (h) => h(App),
}).$mount('#app');
// 子应用中监听卸载事件
window.addEventListener('unmount', function () {
console.log('我被卸载了');
subApp.$destroy();
});
这样修改后,暂时没发现报错了
from micro-app.
这个问题是因为popstate事件影响到所有应用,login子应用接收到事件判断 /goods/路由为非法路由则会兜底加载login的404页面,但此时应用已经被卸载了,导致出错,建议子应用的404在微前端环境去掉吧,统一使用基座应用的
from micro-app.
@bailicangdu 子应用已去掉404,暂不处理404情况;问题还是存在,基座左侧菜单来回切换,点浏览器返回,多切几次,还是会报类似错误,暂时没发现规律。demo已更新。
from micro-app.
👍
from micro-app.
Related Issues (20)
- 子应用卸载内存不回收,内存泄露溢出,页面越来越卡顿,最终导致页面崩溃 HOT 1
- 子应用可以使用哪些富文本 HOT 4
- Vue 3.4.0 出现子应用build后micro-app组件无法渲染的问题 HOT 4
- 子应用A和B循环依赖 HOT 2
- Failed to read the 'localStorage' property from 'Window' : Access is denied for this document HOT 1
- 不支持自定义协议或者file协议 HOT 1
- We're sorry but 项目名称 doesn't work properly without JavaScript enabled. Please enable it to continue HOT 4
- 我该怎样引进非框架构建应用,单纯的html页面。 HOT 3
- 最新版本中setGlobalData新数据后,通过getGlobalData的数据仍然是旧数据 HOT 2
- 您的浏览器暂不支持JavaScript,请尝试高版本或其他浏览器! HOT 2
- 子应用使用了Systemjs后,渲染页面时报错 HOT 1
- 调用unmountAllApps主动卸载所有应用,没有触发生命周期unmount;但是调用unmountApp会触发unmount。
- vite React 主应用 无法开启 vite vue3 with沙箱 以及__webpack_public_path__ is not defined HOT 5
- 火狐浏览器子应用中bpmn设计器不能正常使用,谷歌可以正常使用 HOT 2
- Angular12:micro-app组件在父元素设置了transform: translate3d(100px, 0px, 0px)后,ng-zorro的弹窗组件无法覆盖全局,而是在父元素里 HOT 6
- 子应用配置UMD模式,在主应用中访问时,没有触发mount方法 HOT 7
- 子应用使用vue2+elementUI项目时,elementUI移除元素异常 HOT 3
- js File类型被改变,
- micro-app 使用问题全记录 HOT 6
- 子应用内window.open进程卡死 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro-app.