add support for Form slots in FormSchema config

example:
componentsProps{
	slots:{
		append: ()=>h('span',null,'appendd slot')
	}
}
This commit is contained in:
13636643269 2022-09-03 10:38:00 +08:00
parent 0c60904918
commit 5cefb7286d
1 changed files with 4 additions and 0 deletions

View File

@ -181,6 +181,10 @@ export default defineComponent({
item?.componentProps?.options
) {
slotsMap.default = () => renderOptions(item)
} else if (item.componentProps?.slots) {
// Optionsslots
// 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)