element动态表单校验报错transfer a valid prop path to form item 不知道什么原因
、
<el-dialog title="刊登中及已過期的樓盤,需要轉移給分行管理員" :visible.sync="selectManager" class="assign-dialog"> <el-form required ref="refAllMan" :model="allManager" label-width="100px" :rules="rules">
<div v-for="(item, index) in delStaff" :key="index">
<el-form-item v-if="item.manangers" label=" " :prop="'delStaff.'+index+'.propertyReceiveID'">
<div>
<span>{{ index}}</span> <span v-text="`${group}${item.manangers[0].departmentName}${fenMan}`"></span>
</div>
<el-select v-model="allManager.propertyReceiveID[index]" placeholder="請選擇">
<el-option v-for="(it, ins) in item.manangers" @click.native="setManager(it, index)" :key="ins" :label="it.name" :value="it.accountID"></el-option>
</el-select>
</el-form-item>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="backOutTime">返回</el-button>
<el-button type="primary" @click="nextMan">下一步</el-button>
</span>
</el-dialog>
下面是rules
rules: { propertyReceiveID: [{type:'number',required: true, message: '請選擇管理员', trigger: ["change"] }],
agentReceiveID: [{type:'number',required: true, message: '請選擇代理人', trigger: ["change"] }]
},
不知道为啥报错,的确是prop按照官方文档来的
回答:
你那循环生成的prop和rule里的能对应上?
回答:
你v-for的是delStaff, 而这个应该放到allManager内部也就是 v-for="(item, index) in allManager.delStaff"
回答:
调试看下prop解析的路径是什么
以上是 element动态表单校验报错transfer a valid prop path to form item 不知道什么原因 的全部内容, 来源链接: utcz.com/p/935790.html