fix(ssr): should de-optimize on vnode with PatchFlags.BAIL (#4818)
fix #4679 fix #5771
This commit is contained in:
		
							parent
							
								
									410144149f
								
							
						
					
					
						commit
						cd659fc86f
					
				| @ -97,10 +97,15 @@ export function createHydrationFunctions( | |||||||
|         isFragmentStart |         isFragmentStart | ||||||
|       ) |       ) | ||||||
| 
 | 
 | ||||||
|     const { type, ref, shapeFlag } = vnode |     const { type, ref, shapeFlag, patchFlag } = vnode | ||||||
|     const domType = node.nodeType |     const domType = node.nodeType | ||||||
|     vnode.el = node |     vnode.el = node | ||||||
| 
 | 
 | ||||||
|  |     if (patchFlag === PatchFlags.BAIL) { | ||||||
|  |       optimized = false | ||||||
|  |       vnode.dynamicChildren = null | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     let nextNode: Node | null = null |     let nextNode: Node | null = null | ||||||
|     switch (type) { |     switch (type) { | ||||||
|       case Text: |       case Text: | ||||||
|  | |||||||
| @ -122,13 +122,13 @@ export function defineCustomElement(options: { | |||||||
| 
 | 
 | ||||||
| export function defineCustomElement( | export function defineCustomElement( | ||||||
|   options: any, |   options: any, | ||||||
|   hydate?: RootHydrateFunction |   hydrate?: RootHydrateFunction | ||||||
| ): VueElementConstructor { | ): VueElementConstructor { | ||||||
|   const Comp = defineComponent(options as any) |   const Comp = defineComponent(options as any) | ||||||
|   class VueCustomElement extends VueElement { |   class VueCustomElement extends VueElement { | ||||||
|     static def = Comp |     static def = Comp | ||||||
|     constructor(initialProps?: Record<string, any>) { |     constructor(initialProps?: Record<string, any>) { | ||||||
|       super(Comp, initialProps, hydate) |       super(Comp, initialProps, hydrate) | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user