+
+
+
+
+
+ onClickPage(page)"
+ />
+
+
+
+
+
+
+
+
diff --git a/src/runtime/utils/index.ts b/src/runtime/utils/index.ts
index d2604d00..24ec4ded 100644
--- a/src/runtime/utils/index.ts
+++ b/src/runtime/utils/index.ts
@@ -18,14 +18,18 @@ export const omit = (obj: object, keys: string[]) => {
export const getSlotsChildren = (slots: any) => {
let children = slots.default?.()
if (children.length) {
- if (typeof children[0].type === 'symbol') {
- // @ts-ignore-next
- children = children[0].children
- // @ts-ignore-next
- } else if (children[0].type.name === 'ContentSlot') {
- // @ts-ignore-next
- children = children[0].ctx.slots.default?.()
- }
+ children = children.flatMap(c => {
+ if (typeof c.type === 'symbol') {
+ if (typeof c.children === 'string') {
+ // `v-if="false"` or commented node
+ return
+ }
+ return c.children
+ } else if (c.type.name === 'ContentSlot') {
+ return c.ctx.slots.default?.()
+ }
+ return c
+ }).filter(Boolean)
}
return children
}