types: 修改类型
This commit is contained in:
@@ -176,7 +176,7 @@ export default defineComponent({
|
||||
// const notRenderOptions = ['SelectV2', 'Cascader', 'Transfer']
|
||||
const componentSlots = (item?.componentProps as any)?.slots || {}
|
||||
const slotsMap: Recordable = {
|
||||
...setItemComponentSlots(unref(formModel), componentSlots)
|
||||
...setItemComponentSlots(componentSlots)
|
||||
}
|
||||
// 如果是select组件,并且没有自定义模板,自动渲染options
|
||||
if (item.component === ComponentNameEnum.SELECT) {
|
||||
|
||||
@@ -118,13 +118,13 @@ export const setComponentProps = (item: FormSchema): Recordable => {
|
||||
* @param formModel 表单数据
|
||||
* @param slotsProps 插槽属性
|
||||
*/
|
||||
export const setItemComponentSlots = (formModel: any, slotsProps: Recordable = {}): Recordable => {
|
||||
export const setItemComponentSlots = (slotsProps: Recordable = {}): Recordable => {
|
||||
const slotObj: Recordable = {}
|
||||
for (const key in slotsProps) {
|
||||
if (slotsProps[key]) {
|
||||
if (isFunction(slotsProps[key])) {
|
||||
slotObj[key] = (...args: any[]) => {
|
||||
return slotsProps[key]?.(formModel, ...args)
|
||||
return slotsProps[key]?.(...args)
|
||||
}
|
||||
} else {
|
||||
slotObj[key] = () => {
|
||||
|
||||
Reference in New Issue
Block a user