|
|
@@ -12,7 +12,7 @@ defineProps<Props>()
|
|
|
|
|
|
<template>
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col v-bind="item.props" v-for="(item, index) in formItem.children" :key="index">
|
|
|
+ <el-col :span="item.span" v-bind="item.props" v-for="(item, index) in formItem.children" :key="index">
|
|
|
<component
|
|
|
:is="'el-' + item.type"
|
|
|
v-if="containerTypes.includes(item.type)"
|
|
|
@@ -28,19 +28,17 @@ defineProps<Props>()
|
|
|
</template>
|
|
|
</component>
|
|
|
<template v-else>
|
|
|
- <el-form-item
|
|
|
- v-for="child in item.children"
|
|
|
- :label="child.label"
|
|
|
- :rules="child.rules"
|
|
|
- :prop="child.name"
|
|
|
- v-show="!child.hidden"
|
|
|
- >
|
|
|
- <form-comp :item="child" v-model="formData[child.name]">
|
|
|
- <template #[slot.alias]="slotProps" v-for="slot in child.slots" :key="slot.alias">
|
|
|
- <slot :name="slot.alias" v-bind="slotProps"></slot>
|
|
|
- </template>
|
|
|
- </form-comp>
|
|
|
- </el-form-item>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col v-for="child in item.children" :span="child.span || formConfig.span || 12" v-show="!child.hidden">
|
|
|
+ <el-form-item :label="child.label" :rules="child.rules" :prop="child.name">
|
|
|
+ <form-comp :item="child" v-model="formData[child.name]">
|
|
|
+ <template #[slot.alias]="slotProps" v-for="slot in child.slots" :key="slot.alias">
|
|
|
+ <slot :name="slot.alias" v-bind="slotProps"></slot>
|
|
|
+ </template>
|
|
|
+ </form-comp>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</template>
|
|
|
</el-col>
|
|
|
</el-row>
|