diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index 2bf25ac8e47..f420a678a2f 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -1239,6 +1239,12 @@ export function isClassComponent(value: unknown): value is ClassComponent { } export interface ComponentCustomElementInterface { - injectChildStyle(type: ConcreteComponent): void - removeChildStyle(type: ConcreteComponent): void + /** + * @internal + */ + _injectChildStyle(type: ConcreteComponent): void + /** + * @internal + */ + _removeChildStyle(type: ConcreteComponent): void } diff --git a/packages/runtime-core/src/hmr.ts b/packages/runtime-core/src/hmr.ts index 926d3fa0a51..19ff20de30b 100644 --- a/packages/runtime-core/src/hmr.ts +++ b/packages/runtime-core/src/hmr.ts @@ -162,7 +162,7 @@ function reload(id: string, newComp: HMRComponent) { // update custom element child style if (instance.root.ce && instance !== instance.root) { - instance.root.ce.removeChildStyle(oldComp) + instance.root.ce._removeChildStyle(oldComp) } } diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 588a58e34ca..2415307bb5f 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -1337,7 +1337,7 @@ function baseCreateRenderer( } else { // custom element style injection if (root.ce) { - root.ce.injectChildStyle(type) + root.ce._injectChildStyle(type) } if (__DEV__) { diff --git a/packages/runtime-dom/src/apiCustomElement.ts b/packages/runtime-dom/src/apiCustomElement.ts index 2684e97ea51..6af68193a08 100644 --- a/packages/runtime-dom/src/apiCustomElement.ts +++ b/packages/runtime-dom/src/apiCustomElement.ts @@ -609,11 +609,17 @@ export class VueElement } } - injectChildStyle(comp: ConcreteComponent & CustomElementOptions) { + /** + * @internal + */ + _injectChildStyle(comp: ConcreteComponent & CustomElementOptions) { this._applyStyles(comp.styles, comp) } - removeChildStyle(comp: ConcreteComponent): void { + /** + * @internal + */ + _removeChildStyle(comp: ConcreteComponent): void { if (__DEV__) { this._styleChildren.delete(comp) if (this._childStyles && comp.__hmrId) {