Skip to content

Commit 8eda200

Browse files
committed
fix: add space for slot and add example
1 parent 9ad79dd commit 8eda200

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div>
3+
<h1><ContentSlot :use="$slots.title" unwrap="p" /></h1>
34
<ContentSlot :use="$slots.default" />
45
</div>
56
</template>

src/module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export default defineNuxtModule<ModuleOptions>({
5252
(component, code) => {
5353
code = code.replace(
5454
/<ContentSlot(.*)?:use="\$slots\.([a-z]+)"(.*)\/>/gm,
55-
(_, before, slotName, rest) => {
56-
return `<slot${slotName === 'default' ? '' : `name="${slotName}"`} />`
55+
(_, _before, slotName, _rest) => {
56+
return `<slot ${slotName === 'default' ? '' : `name="${slotName}"`} />`
5757
}
5858
)
5959

0 commit comments

Comments
 (0)