Skip to content

Commit 7b4a803

Browse files
committed
refactor: move trim to process function
1 parent 7b576f6 commit 7b4a803

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/mount.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export function mount(
236236

237237
if (typeof slot === 'string') {
238238
// slot is most probably a scoped slot string or a plain string
239-
acc[name] = (props: VNodeProps) => h(processSlot(slot.trim()), props)
239+
acc[name] = (props: VNodeProps) => h(processSlot(slot), props)
240240
return acc
241241
}
242242

src/utils/compileSlots.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { compile } from '@vue/compiler-dom'
22
import * as vue from 'vue'
33

4-
export function processSlot(template = '', Vue = vue) {
4+
export function processSlot(source = '', Vue = vue) {
5+
let template = source.trim()
56
const hasWrappingTemplate = template && template.startsWith('<template')
67

78
// allow content without `template` tag, for easier testing

0 commit comments

Comments
 (0)