1个回答

test
2024-07-11
<el-form ref="contributionsModelFormRef" label-suffix=":" :model="contributionsModel">
<div class="chooseModalMainRow">
<el-row class="row" v-for="( item, index ) in contributionsModel.contributionsArr" :key="item.id">
<el-col :span="12">
<el-form-item :label="'员工'" :prop="`contributionsArr[${index}].employeeId`"
:rules="contributionsModel.rules.employeeId">
主要难点在于每一行的验证数据的绑定上. 参考上面代码里面的:prop写法,搭配单独分配的:rules配合完成验证.这样可以每一行单独验证.
回复

适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容