Skip to content

Commit 03fb23f

Browse files
committed
fix(ssr): should remove dynamic children if patchFlag is bail
1 parent 5eb7263 commit 03fb23f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/runtime-core/src/hydration.ts

+4
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export function createHydrationFunctions(
9999
const domType = node.nodeType
100100
vnode.el = node
101101

102+
if (vnode.patchFlag === PatchFlags.BAIL) {
103+
vnode.dynamicChildren = null
104+
}
105+
102106
let nextNode: Node | null = null
103107
switch (type) {
104108
case Text:

packages/runtime-dom/src/apiCustomElement.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ export function defineCustomElement(options: {
122122

123123
export function defineCustomElement(
124124
options: any,
125-
hydate?: RootHydrateFunction
125+
hydrate?: RootHydrateFunction
126126
): VueElementConstructor {
127127
const Comp = defineComponent(options as any)
128128
class VueCustomElement extends VueElement {
129129
static def = Comp
130130
constructor(initialProps?: Record<string, any>) {
131-
super(Comp, initialProps, hydate)
131+
super(Comp, initialProps, hydrate)
132132
}
133133
}
134134

0 commit comments

Comments
 (0)