Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Feb 10, 2025
1 parent 3684d65 commit 26698aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ import { isAsyncWrapper } from './apiAsyncComponent'
import { isCompatEnabled } from './compat/compatConfig'
import { DeprecationTypes } from './compat/compatConfig'
import type { TransitionHooks } from './components/BaseTransition'
import type { VueElement } from '@vue/runtime-dom'

export interface Renderer<HostElement = RendererElement> {
render: RootRenderFunction<HostElement>
Expand Down Expand Up @@ -1348,7 +1349,10 @@ function baseCreateRenderer(
} else {
// custom element style injection
if (root.ce) {
root.ce._injectChildStyle(type)
// @ts-expect-error _def is private
if ((root.ce as VueElement)._def.shadowRoot !== false) {
root.ce._injectChildStyle(type)
}
}

if (__DEV__) {
Expand Down
4 changes: 1 addition & 3 deletions packages/runtime-dom/src/apiCustomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,7 @@ export class VueElement
* @internal
*/
_injectChildStyle(comp: ConcreteComponent & CustomElementOptions): void {
if (this._def.shadowRoot !== false) {
this._applyStyles(comp.styles, comp)
}
this._applyStyles(comp.styles, comp)
}

/**
Expand Down

0 comments on commit 26698aa

Please sign in to comment.