]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(custom-elements): custom element should re-instantiate when inserted again (...
authorysy945 <79794654+ysy945@users.noreply.github.com>
Fri, 11 Nov 2022 09:06:21 +0000 (17:06 +0800)
committerGitHub <noreply@github.com>
Fri, 11 Nov 2022 09:06:21 +0000 (04:06 -0500)
fix #6934

packages/runtime-dom/src/apiCustomElement.ts

index 4de753e38bed4f532fe3a2b4f8e652180d057382..7710d57216aedf98c046e3c349055cd1f38915d4 100644 (file)
@@ -196,7 +196,11 @@ export class VueElement extends BaseClass {
   connectedCallback() {
     this._connected = true
     if (!this._instance) {
-      this._resolveDef()
+      if (this._resolved) {
+        this._update()
+      } else {
+        this._resolveDef()
+      }
     }
   }
 
@@ -214,9 +218,6 @@ export class VueElement extends BaseClass {
    * resolve inner component definition (handle possible async component)
    */
   private _resolveDef() {
-    if (this._resolved) {
-      return
-    }
     this._resolved = true
 
     // set initial attrs