File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -145,12 +145,12 @@ describe('ssr: slot', () => {
145
145
createApp ( {
146
146
components : {
147
147
one : {
148
- template : `<transition ><slot/></transition >` ,
148
+ template : `<TransitionGroup tag="div" ><slot/></TransitionGroup >` ,
149
149
} ,
150
150
} ,
151
151
template : `<one><p v-for="i in 2">{{i}}</p></one>` ,
152
152
} ) ,
153
153
) ,
154
- ) . toBe ( `<p>1</p><p>2</p>` )
154
+ ) . toBe ( `<div>< p>1</p><p>2</p></div >` )
155
155
} )
156
156
} )
Original file line number Diff line number Diff line change @@ -83,18 +83,16 @@ export function ssrRenderSlotInner(
83
83
}
84
84
} else {
85
85
for ( let i = 0 ; i < slotBuffer . length ; i ++ ) {
86
+ const buffer = slotBuffer [ i ]
86
87
// #9933
87
88
// Although we handle Transition/TransitionGroup in the transform stage
88
- // without rendering them as fragments , the content passed into the slot
89
+ // without rendering it as a fragment , the content passed into the slot
89
90
// may still be a fragment.
90
91
// Therefore, here we need to avoid rendering it as a fragment again.
91
- if (
92
- transition &&
93
- ( slotBuffer [ i ] === '<!--[-->' || slotBuffer [ i ] === '<!--]-->' )
94
- ) {
92
+ if ( transition && ( buffer === '<!--[-->' || buffer === '<!--]-->' ) ) {
95
93
continue
96
94
}
97
- push ( slotBuffer [ i ] )
95
+ push ( buffer )
98
96
}
99
97
}
100
98
}
You can’t perform that action at this time.
0 commit comments