|
@@ -1,9 +1,10 @@
|
|
<template>
|
|
<template>
|
|
<div id="c-form">
|
|
<div id="c-form">
|
|
<el-row type="flex" justify="space-around">
|
|
<el-row type="flex" justify="space-around">
|
|
- <el-col :span="span">
|
|
|
|
|
|
+ <el-col>
|
|
<el-form ref="formRef" :model="form" :rules="rules" :label-width="labelWidth" class="form" @submit.prevent>
|
|
<el-form ref="formRef" :model="form" :rules="rules" :label-width="labelWidth" class="form" @submit.prevent>
|
|
- <template v-for="(item, index) in fields">
|
|
|
|
|
|
+ <!-- <template > -->
|
|
|
|
+ <el-col :span="span" v-for="(item, index) in fields" :key="index">
|
|
<el-form-item v-if="display(item)" :key="'form-field-' + index" :label="getField('label', item)" :prop="item.model" :required="item.required">
|
|
<el-form-item v-if="display(item)" :key="'form-field-' + index" :label="getField('label', item)" :prop="item.model" :required="item.required">
|
|
<template v-if="!item.custom">
|
|
<template v-if="!item.custom">
|
|
<template v-if="item.type === 'textarea'">
|
|
<template v-if="item.type === 'textarea'">
|
|
@@ -123,7 +124,8 @@
|
|
<slot :name="item.model" v-bind="{ item }"></slot>
|
|
<slot :name="item.model" v-bind="{ item }"></slot>
|
|
</template>
|
|
</template>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </template>
|
|
|
|
|
|
+ </el-col>
|
|
|
|
+ <!-- </template> -->
|
|
<el-col :span="24" label="" class="btn" v-if="isSave">
|
|
<el-col :span="24" label="" class="btn" v-if="isSave">
|
|
<slot name="submit">
|
|
<slot name="submit">
|
|
<el-button type="primary" @click="save(formRef)">{{ submitText }}</el-button>
|
|
<el-button type="primary" @click="save(formRef)">{{ submitText }}</el-button>
|
|
@@ -217,4 +219,9 @@ const dataChange = (model: string) => {
|
|
.btn {
|
|
.btn {
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
+.form {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|