Tears must be kept, stepping on the pit crazily on the edge of success...
eg: Check the element groupList in the form : [{man:''},{man:''}]
data(){
return{
form:{
groupList: [{ man: '' }, { man: '' }]
}
}
}
Setting: Effective key : prop="`groupList[${index}].man`"
<el-form :model="form">
<div v-for="(item,index) in form.groupList" :key="index">
<el-form-item :label="item.label" :prop="`groupList[${index}].man`" :rules="{required:true,message:`请输入男性占比`,trigger:'blur'}">
<el-input v-model="item.man" placeholder="请输入数值" clearable> </el-input>
</el-form-item>
</div>
</el-form>
It's finally done! ! ! !