Skip to content

shadowroot中无法加载样式 #8142

Closed
@rockeralx

Description

@rockeralx
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

chrome:135.0.7049.114,vue:3.5.13,系统:macos Sequoia 15.3.1

Reproduction link

Edit on CodeSandbox

Steps to reproduce

//mian.ts
let container = document.getElementById('app')
const shadowRoot = container.attachShadow({mode: 'open'})
let root = document.createElement('div')
root.setAttribute('id', 'app')
shadowRoot.appendChild(root)
app.mount(root)
<script setup lang="ts">
//面板容器
let hrpContainer = ref(null)
let visible = ref(false);
</script>
<template>
<div class="hrp-container" v-show="!visible" ref="hrpContainer">
<div class="hrp-button" v-if="hrpContainer">
<a-tooltip placement="left" :get-popup-container="()=>hrpContainer.parentElement" title="网页助手">
<div class="loading-container" key="ball-loading">
<span>加</span>
<span>载</span>
<span>中</span>
</div>
</a-tooltip>
</div>
</div>
</template>

What is expected?

提供相关的配置,能够正确在shadowroot中加载

What is actually happening?

无法加载组件样式

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions