1
0
mirror of synced 2024-11-25 14:56:03 +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>
<FormulateSlot
name="grouping"
class="formulate-input-grouping"
:context="context"
>
<FormulateRepeatableProvider

View File

@ -9,6 +9,10 @@ export default {
if (p.$scopedSlots && p.$scopedSlots[props.name]) {
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]
}
}