add support for Form slots in FormSchema config
example: componentsProps{ slots:{ append: ()=>h('span',null,'appendd slot') } }
This commit is contained in:
parent
0c60904918
commit
5cefb7286d
|
@ -181,6 +181,10 @@ export default defineComponent({
|
|||
item?.componentProps?.options
|
||||
) {
|
||||
slotsMap.default = () => renderOptions(item)
|
||||
} else if (item.componentProps?.slots) {
|
||||
// 非Options的组件,通过slots配置,渲染组件
|
||||
// 例如 componentProps{slots:{append: ()=>h('span',null,'appendComponent')}}
|
||||
Object.entries(item.componentProps.slots).forEach((slot) => (slotsMap[slot[0]] = slot[1]))
|
||||
}
|
||||
|
||||
const formItemSlots: Recordable = setFormItemSlots(slots, item.field)
|
||||
|
|
Loading…
Reference in New Issue