File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/runtime-core/src/helpers Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1- import { Slot } from '../componentSlots'
21import { isArray } from '@vue/shared'
2+ import { VNode } from '../vnode'
3+
4+ // #6651 res can be undefined in SSR in string push mode
5+ type SSRSlot = ( ...args : any [ ] ) => VNode [ ] | undefined
36
47interface CompiledSlotDescriptor {
58 name : string
6- fn : Slot
9+ fn : SSRSlot
710 key ?: string
811}
912
@@ -12,13 +15,13 @@ interface CompiledSlotDescriptor {
1215 * @private
1316 */
1417export function createSlots (
15- slots : Record < string , Slot > ,
18+ slots : Record < string , SSRSlot > ,
1619 dynamicSlots : (
1720 | CompiledSlotDescriptor
1821 | CompiledSlotDescriptor [ ]
1922 | undefined
2023 ) [ ]
21- ) : Record < string , Slot > {
24+ ) : Record < string , SSRSlot > {
2225 for ( let i = 0 ; i < dynamicSlots . length ; i ++ ) {
2326 const slot = dynamicSlots [ i ]
2427 // array of dynamic slot generated by <template v-for="..." #[...]>
@@ -33,7 +36,6 @@ export function createSlots(
3336 const res = slot . fn ( ...args )
3437 // attach branch key so each conditional branch is considered a
3538 // different fragment
36- // #6651 res can be undefined in SSR in string push mode
3739 if ( res ) ( res as any ) . key = slot . key
3840 return res
3941 }
You can’t perform that action at this time.
0 commit comments