mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-26 18:00:43 +01:00
fix(ButtonGroup/AvatarGroup): allow v-for (#173)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -36,10 +36,15 @@ export default defineComponent({
|
|||||||
|
|
||||||
const children = computed(() => {
|
const children = computed(() => {
|
||||||
let children = slots.default?.()
|
let children = slots.default?.()
|
||||||
// @ts-ignore-next
|
if (children.length) {
|
||||||
if (children.length && children[0].type.name === 'ContentSlot') {
|
if (typeof children[0].type === 'symbol') {
|
||||||
|
// @ts-ignore-next
|
||||||
|
children = children[0].children
|
||||||
// @ts-ignore-next
|
// @ts-ignore-next
|
||||||
children = children[0].ctx.slots.default?.()
|
} else if (children[0].type.name === 'ContentSlot') {
|
||||||
|
// @ts-ignore-next
|
||||||
|
children = children[0].ctx.slots.default?.()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return children
|
return children
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -30,10 +30,15 @@ export default defineComponent({
|
|||||||
|
|
||||||
const children = computed(() => {
|
const children = computed(() => {
|
||||||
let children = slots.default?.()
|
let children = slots.default?.()
|
||||||
// @ts-ignore-next
|
if (children.length) {
|
||||||
if (children.length && children[0].type.name === 'ContentSlot') {
|
if (typeof children[0].type === 'symbol') {
|
||||||
|
// @ts-ignore-next
|
||||||
|
children = children[0].children
|
||||||
// @ts-ignore-next
|
// @ts-ignore-next
|
||||||
children = children[0].ctx.slots.default?.()
|
} else if (children[0].type.name === 'ContentSlot') {
|
||||||
|
// @ts-ignore-next
|
||||||
|
children = children[0].ctx.slots.default?.()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return children
|
return children
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user