File tree 1 file changed +7
-5
lines changed
packages/runtime-core/src/helpers
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
- import { Slot } from '../componentSlots'
2
1
import { 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
3
6
4
7
interface CompiledSlotDescriptor {
5
8
name : string
6
- fn : Slot
9
+ fn : SSRSlot
7
10
key ?: string
8
11
}
9
12
@@ -12,13 +15,13 @@ interface CompiledSlotDescriptor {
12
15
* @private
13
16
*/
14
17
export function createSlots (
15
- slots : Record < string , Slot > ,
18
+ slots : Record < string , SSRSlot > ,
16
19
dynamicSlots : (
17
20
| CompiledSlotDescriptor
18
21
| CompiledSlotDescriptor [ ]
19
22
| undefined
20
23
) [ ]
21
- ) : Record < string , Slot > {
24
+ ) : Record < string , SSRSlot > {
22
25
for ( let i = 0 ; i < dynamicSlots . length ; i ++ ) {
23
26
const slot = dynamicSlots [ i ]
24
27
// array of dynamic slot generated by <template v-for="..." #[...]>
@@ -33,7 +36,6 @@ export function createSlots(
33
36
const res = slot . fn ( ...args )
34
37
// attach branch key so each conditional branch is considered a
35
38
// different fragment
36
- // #6651 res can be undefined in SSR in string push mode
37
39
if ( res ) ( res as any ) . key = slot . key
38
40
return res
39
41
}
You can’t perform that action at this time.
0 commit comments