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

最新版子应用下 document.body 还是会出现逃逸问题 #1452

Open
w7team opened this issue Nov 22, 2024 · 2 comments
Open

最新版子应用下 document.body 还是会出现逃逸问题 #1452

w7team opened this issue Nov 22, 2024 · 2 comments

Comments

@w7team
Copy link

w7team commented Nov 22, 2024

子应用下 document.body 还是会出现逃逸问题,目前限制在子应用内操作,会直接到主应用的body下

效果如下:
image

子应用源代码:
image

主应用源代码:
image

环境信息

  • micro-app版本:1.0.0-rc.13
  • 主应用前端框架&版本:"vite": "^5.4.10"
  • 子应用前端框架&版本:纯html
@lideveloper
Copy link

如果子应用需要把元素挂载到body,在iframe模式下确实一直有这个问题,现在会把元素挂载到主应用的body上面,原因就是子应用的document.body指向了父应用的body

@qingfengdai
Copy link

发现iframe模式下子应用的多个第三方的依赖因为body出现问题了,像antd的message,会挂载到主应用上面而无法消失,handsontable会在失去焦点时崩溃,还有视频播放插件等,with模式不存在这样的问题,但是vite项目又无法使用with模式

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

3 participants