From 50dd486043d2dc6fa5c97f1559ce5dececa7bf91 Mon Sep 17 00:00:00 2001 From: daiwei Date: Wed, 11 Sep 2024 15:56:44 +0800 Subject: [PATCH] chore: fix the underlying problem --- packages/runtime-dom/src/apiCustomElement.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/runtime-dom/src/apiCustomElement.ts b/packages/runtime-dom/src/apiCustomElement.ts index 360e78134c1..bb135df84ea 100644 --- a/packages/runtime-dom/src/apiCustomElement.ts +++ b/packages/runtime-dom/src/apiCustomElement.ts @@ -277,7 +277,10 @@ export class VueElement } connectedCallback(): void { - if (!this.shadowRoot && !this._slots) { + // aviod resolving component if it's not connected + if (!this.isConnected) return + + if (!this.shadowRoot) { this._parseSlots() } this._connected = true