<el-form-item v-for="(domain, index) in dynamicValidateForm.domains" :label="'域名' + index" :key="domain.key" :prop="'domains.' + index + '.value'" :rules="{ required: true, message: '域名不能为空', trigger: 'blur' }" > <el-input v-model="domain.value"></el-input><el-button @click.prevent="removeDomain(domain)">删除</el-button> </el-form-item>
疑惑的地方:
:prop="'domains.' + index + '.value'"
为什么prop中是'domains.+index+.value'而不是'dynamicValidateForm.domains+index+.value'或者'domain.value'?
相关分类