File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { compile } from '@vue/compiler-dom'
2
2
import * as vue from 'vue'
3
3
4
- export function processSlot ( template = '' , Vue = vue ) {
4
+ export function processSlot ( source = '' , Vue = vue ) {
5
+ let template = source . trim ( )
5
6
const hasWrappingTemplate = template && template . startsWith ( '<template' )
6
7
7
8
// allow content without `template` tag, for easier testing
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