Skip to content

Commit e791904

Browse files
committed
fix(runtime-core): update __vnode of static nodes when patching along the optimized path
1 parent 4f79253 commit e791904

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/runtime-core/src/renderer.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -2484,10 +2484,14 @@ export function traverseStaticChildren(
24842484
if (c2.type === Text) {
24852485
c2.el = c1.el
24862486
}
2487-
// also inherit for comment nodes, but not placeholders (e.g. v-if which
2488-
// would have received .el during block patch)
2489-
if (__DEV__ && c2.type === Comment && !c2.el) {
2490-
c2.el = c1.el
2487+
if (__DEV__ ) {
2488+
// #2324 also inherit for comment nodes, but not placeholders (e.g. v-if which
2489+
// would have received .el during block patch)
2490+
if(c2.type === Comment && !c2.el) {
2491+
c2.el = c1.el
2492+
}
2493+
2494+
c2.el && (c2.el.__vnode = c2)
24912495
}
24922496
}
24932497
}

0 commit comments

Comments
 (0)