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

子应用的swiperjs使用自定义元素,会报错Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed #1386

Open
justseeseesee opened this issue Sep 25, 2024 · 1 comment
Assignees

Comments

@justseeseesee
Copy link

问题描述

出现错误Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot': Sharing constructed stylesheets in multiple documents is not allowed

复现步骤

1.主应用vite_vue3 micro-app最新版本rc-10
2.子应用vite_vue3

上传截图

image

复现仓库

仓库demo

环境信息

  • micro-app版本:1.0.0rc-10
  • 主应用前端框架&版本:vite_vue3
  • 子应用前端框架&版本:vite_vue3
  • 构建工具&版本:vite
@timhub66 timhub66 self-assigned this Sep 26, 2024
@AdonLee
Copy link

AdonLee commented Nov 15, 2024

这是因为Swiper组装样式用了沙箱里的CSSStyleSheet导致的,把基座的CSSStyleSheet注入到子app中就好了,代码参考
image

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