File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ export function mount(
236
236
237
237
if ( typeof slot === 'string' ) {
238
238
// slot is most probably a scoped slot string or a plain string
239
- acc [ name ] = ( props : VNodeProps ) => h ( processSlot ( slot ) , props )
239
+ acc [ name ] = ( props : VNodeProps ) => h ( processSlot ( slot . trim ( ) ) , props )
240
240
return acc
241
241
}
242
242
Original file line number Diff line number Diff line change @@ -141,9 +141,13 @@ describe('slots', () => {
141
141
} )
142
142
143
143
it ( 'allows passing a scoped slot via string with no destructuring using the v-slot syntax ' , ( ) => {
144
+ // Note: there is intentionally a carriage return after the first ` in the scoped key.
145
+ // https://github.com/vuejs/vue-test-utils-next/issues/202
144
146
const wrapper = mount ( ComponentWithSlots , {
145
147
slots : {
146
- scoped : `<template v-slot:scoped="params"><div>Just a plain {{ params.boolean }} {{ params.string }}</div></template>`
148
+ scoped : `
149
+ <template v-slot:scoped="params"><div>Just a plain {{ params.boolean }} {{ params.string }}</div></template>
150
+ `
147
151
}
148
152
} )
149
153
You can’t perform that action at this time.
0 commit comments