diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index 70f39cacb15..94d6e8f6277 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -15,7 +15,7 @@ import { ComponentInternalInstance } from './component' import { invokeDirectiveHook } from './directives' import { warn } from './warning' import { PatchFlags, ShapeFlags, isReservedProp, isOn } from '@vue/shared' -import { RendererInternals } from './renderer' +import { needTransition, RendererInternals } from './renderer' import { setRef } from './rendererTemplateRef' import { SuspenseImpl, @@ -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 @@ -145,7 +160,16 @@ export function createHydrationFunctions( } break case Comment: - if (domType !== DOMNodeTypes.COMMENT || isFragmentStart) { + if (isTemplateNode(node)) { + nextNode = nextSibling(node) + // wrapped + // replace