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

Closed
w7team opened this issue Nov 22, 2024 · 6 comments
Closed

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

w7team opened this issue Nov 22, 2024 · 6 comments
Assignees
Labels
fixed Issue fixed

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模式

@timhub66 timhub66 self-assigned this Jan 23, 2025
@timhub66 timhub66 added the fixed Issue fixed label Jan 24, 2025
Copy link

Hello @w7team. The issue you reported has been fixed. This issue will be closed. Thank you for your feedback.
您好 @w7team,您反馈的问题已修复,该 issue 将要被关闭,感谢反馈。

@ncwsszs
Copy link

ncwsszs commented Feb 7, 2025

请问解决了吗?我这边使用1.0.0-rc.20版本,预加载还是会出现这个问题。

@w7team
Copy link
Author

w7team commented Feb 7, 2025

还没测试,目前micro-app会改变body标签,是个硬伤,内部样式会有不兼容的情况

@timhub66
Copy link
Collaborator

请问解决了吗?我这边使用1.0.0-rc.20版本,预加载还是会出现这个问题。

@ncwsszs ,可以提供一个demo,我来看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issue fixed
Projects
None yet
Development

No branches or pull requests

5 participants