please transfer a valid prop path to form item!
<el-form ref="formRef1" :model="form1" :rules="rules1" label-width="180px">
<el-form-item
:label="`编号:${it}`"
:prop="`sampleData[${it}]`"
:rules="{ required: true, message: `请输入${it}值`, trigger: 'blur' }"
>
<el-input v-model="form1.sampleData[it]" placeholder="请输入测定值" />
</el-form-item>
</el-form>
data() {
return {
form1: {
sampleData: {}
},
rules1: {},
}
},
created() {
getFormDetail(this.xxx.id).then(({ data }) => {
const params = {}
data?.forEach(item => {
params[item] = ''
})
this.form1 = {
...this.form1,
sampleData: { ...params }
}
})
}