1
0
mirror of synced 2024-11-29 08:36:12 +03:00

Improved deep slot support

This commit is contained in:
Justin Schroeder 2020-05-04 14:50:32 -04:00
parent f7248d029c
commit 430f27f24c
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
<template> <template>
<FormulateSlot <FormulateSlot
name="grouping" name="grouping"
class="formulate-input-grouping"
:context="context" :context="context"
> >
<FormulateRepeatableProvider <FormulateRepeatableProvider

View File

@ -9,6 +9,10 @@ export default {
if (p.$scopedSlots && p.$scopedSlots[props.name]) { if (p.$scopedSlots && p.$scopedSlots[props.name]) {
return p.$scopedSlots[props.name](props.context || props) return p.$scopedSlots[props.name](props.context || props)
} }
return h('div', data, children) if (children.length > 1) {
const { name, context, ...attrs } = data.attrs
return h('div', { ...data, ...{ attrs } }, children)
}
return children[0]
} }
} }