Skip to content

Commit a6ae876

Browse files
committed
fix: hydration __vnode missing
1 parent b8fc18c commit a6ae876

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/runtime-core/src/hydration.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ export function createHydrationFunctions(
111111
let domType = node.nodeType
112112
vnode.el = node
113113

114+
if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
115+
Object.defineProperty(node, '__vnode', {
116+
value: vnode,
117+
enumerable: false
118+
})
119+
Object.defineProperty(node, '__vueParentComponent', {
120+
value: parentComponent,
121+
enumerable: false
122+
})
123+
}
124+
114125
if (patchFlag === PatchFlags.BAIL) {
115126
optimized = false
116127
vnode.dynamicChildren = null

0 commit comments

Comments
 (0)