Skip to content

Commit 26698aa

Browse files
committed
chore: update
1 parent 3684d65 commit 26698aa

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/runtime-core/src/renderer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ import { isAsyncWrapper } from './apiAsyncComponent'
8686
import { isCompatEnabled } from './compat/compatConfig'
8787
import { DeprecationTypes } from './compat/compatConfig'
8888
import type { TransitionHooks } from './components/BaseTransition'
89+
import type { VueElement } from '@vue/runtime-dom'
8990

9091
export interface Renderer<HostElement = RendererElement> {
9192
render: RootRenderFunction<HostElement>
@@ -1348,7 +1349,10 @@ function baseCreateRenderer(
13481349
} else {
13491350
// custom element style injection
13501351
if (root.ce) {
1351-
root.ce._injectChildStyle(type)
1352+
// @ts-expect-error _def is private
1353+
if ((root.ce as VueElement)._def.shadowRoot !== false) {
1354+
root.ce._injectChildStyle(type)
1355+
}
13521356
}
13531357

13541358
if (__DEV__) {

packages/runtime-dom/src/apiCustomElement.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,7 @@ export class VueElement
661661
* @internal
662662
*/
663663
_injectChildStyle(comp: ConcreteComponent & CustomElementOptions): void {
664-
if (this._def.shadowRoot !== false) {
665-
this._applyStyles(comp.styles, comp)
666-
}
664+
this._applyStyles(comp.styles, comp)
667665
}
668666

669667
/**

0 commit comments

Comments
 (0)