Skip to content

Commit

Permalink
fix(ssr): hydration __vnode missing for devtools (#9328)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Nov 10, 2023
1 parent e15dc05 commit 5156ac5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/runtime-core/src/hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,21 @@ export function createHydrationFunctions(
let domType = node.nodeType
vnode.el = node

if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
if (!('__vnode' in node)) {
Object.defineProperty(node, '__vnode', {
value: vnode,
enumerable: false
})
}
if (!('__vueParentComponent' in node)) {
Object.defineProperty(node, '__vueParentComponent', {
value: parentComponent,
enumerable: false
})
}
}

if (patchFlag === PatchFlags.BAIL) {
optimized = false
vnode.dynamicChildren = null
Expand Down

0 comments on commit 5156ac5

Please sign in to comment.