Comments (4)
我看了下,现在是把子应用的window.onxxx直接指向主应用的window.onxxx
这样多个子应用同时用到window.onxxx的话会有问题,没有隔离
为什么不直接挂在iframeWindow上呢?
此外可能需要在mount和unmount的时候手动处理一些事件了
from wujie.
不管挂哪里都是有问题的,比如:挂在 iframeWindow.onload上,iframe 是一开始就准备好的,子应用的 js 是 iframe ready 后注入的也就是说 js 里面的 window.onload 事件永远都不会触发,这个地方估计要框架维护一个针对 load 事件、domContentLoaded事件之类的事件列表,进行手动触发。
当然框架也提供了 plugin:windowAddEventListenerHook、windowPropertyOverride,用户可以自行 diy 这个地方
from wujie.
这个地方估计要框架维护一个针对 load 事件、domContentLoaded事件之类的事件列表,进行手动触发。
对,我的意思就是直接挂在iframeWindow上,然后手动在对应的生命周期里invoke,避免多个子应用互相干扰
from wujie.
明白,这个地方如果有兴趣可以 pr,我估计没这么快
from wujie.
Related Issues (20)
- 孙子应用的自定义@font-face不生效
- 子应用弹窗显示不了图片,position:fixed;或者absolute的时候不能展示图片。都是用的vue2,双向绑定也没问题就是渲染的时候img表情的src是空的
- window.$wujie.location.href 跳转问题 HOT 1
- 子应用中Popconfirm的确认事件无法被正确触发 HOT 2
- 这个仓库还在维护吗 HOT 9
- 子应用中使用 document.documentElement.addEventListener('keydown', ()=>{}) 绑定事件不生效
- wujie中无法正常是用worker HOT 5
- 子应用中鼠标事件获取offset的值是基于wujie-app,不是基于指定元素
- vue3什么时候可以作为基座 HOT 1
- 子应用偶现白屏,且无报错 HOT 1
- 子应用打包部署后,antd组件库样式问题 HOT 2
- OffScreenCanvas无法使用自定义字体,Canvas和HTML可以应用自定义字体。 HOT 1
- 无界子应用集成@tiptap富文本,第二次打开子应用时,中文输入法输入'@',会连续出现两个(@@),window.getSelection()永远为None HOT 1
- 3层嵌套的情况下,不同UI框架,字体图标不显示问题 HOT 1
- ios中子应用白屏,没有报错,看现象子应用中对应的js文件没加载,安卓正常 HOT 3
- jquery开发的项目,集成到无界时,js和css文件资源加载自动被注释,导致页面错乱 HOT 1
- 路由后退无反应问题 HOT 6
- 子系统的静态资源无法加载 HOT 1
- 官方可否写一个集成jQuery那种老的项目的demo
- 官网卡死, 100%复现
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 wujie.