Skip to content

Commit 6e63bec

Browse files
ysy945zhangzhonghe
authored andcommitted
fix(custom-elements): custom element should re-instantiate when inserted again (vuejs#6966)
fix vuejs#6934
1 parent 370e4e6 commit 6e63bec

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/runtime-dom/src/apiCustomElement.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ export class VueElement extends BaseClass {
196196
connectedCallback() {
197197
this._connected = true
198198
if (!this._instance) {
199-
this._resolveDef()
199+
if (this._resolved) {
200+
this._update()
201+
} else {
202+
this._resolveDef()
203+
}
200204
}
201205
}
202206

@@ -214,9 +218,6 @@ export class VueElement extends BaseClass {
214218
* resolve inner component definition (handle possible async component)
215219
*/
216220
private _resolveDef() {
217-
if (this._resolved) {
218-
return
219-
}
220221
this._resolved = true
221222

222223
// set initial attrs

0 commit comments

Comments
 (0)