Skip to content

Commit 6d69367

Browse files
committed
fix: improve content slot support
1 parent 228c397 commit 6d69367

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/module.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ export default defineNuxtModule<ModuleOptions>({
4646
return `<slot ${slotName === 'default' ? '' : `name="${slotName}"`} />`
4747
}
4848
)
49+
code = code.replace(
50+
/<ContentSlot(.*)?name="([a-z]+)"(.*)\/>/gm,
51+
(_, _before, slotName, _rest) => {
52+
return `<slot ${slotName === 'default' ? '' : `name="${slotName}"`} />`
53+
}
54+
)
4955

5056
return { component, code }
5157
}

0 commit comments

Comments
 (0)