Skip to content

Commit db5a631

Browse files
committed
chore: update test
1 parent ab06b28 commit db5a631

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/runtime-core/__tests__/hydration.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import {
2121
renderSlot,
2222
Transition,
2323
createCommentVNode,
24-
vShow
24+
vShow,
25+
vShowOldKey
2526
} from '@vue/runtime-dom'
2627
import { renderToString, SSRContext } from '@vue/server-renderer'
2728
import { PatchFlags } from '../../shared/src'
@@ -1060,7 +1061,7 @@ describe('SSR hydration', () => {
10601061
foo
10611062
</div>
10621063
`)
1063-
expect((container.firstChild as any)._vod).toBe('')
1064+
expect((container.firstChild as any)[vShowOldKey]).toBe('')
10641065
expect(vnode.el).toBe(container.firstChild)
10651066
expect(`mismatch`).not.toHaveBeenWarned()
10661067
})

packages/runtime-core/src/hydration.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,6 @@ export function createHydrationFunctions(
385385
if ((vnodeHooks = props && props.onVnodeBeforeMount)) {
386386
invokeVNodeHook(vnodeHooks, parentComponent, vnode)
387387
}
388-
if (dirs) {
389-
invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount')
390-
}
391388

392389
let needCallTransitionHooks = false
393390
if (
@@ -419,6 +416,8 @@ export function createHydrationFunctions(
419416
parent = parent.parent
420417
}
421418
el = content
419+
} else if (dirs) {
420+
invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount')
422421
}
423422

424423
if (

packages/runtime-dom/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export {
229229
vModelDynamic
230230
} from './directives/vModel'
231231
export { withModifiers, withKeys } from './directives/vOn'
232-
export { vShow } from './directives/vShow'
232+
export { vShow, vShowOldKey } from './directives/vShow'
233233

234234
import { initVModelForSSR } from './directives/vModel'
235235
import { initVShowForSSR } from './directives/vShow'

0 commit comments

Comments
 (0)