<el-form ref="form" :model="form">
<el-table ref="Table" :data="form.tableData">
注意!验证的table数据一定要在form表单 form的对象里
例子 form:{tableData:[]}不然就报
please transfer a valid prop path to form item!
我一直以为是-1后来发现不是
然后这样也行
<template #default="{ row, $index }">
<el-form-item :prop="`tableData.${$index}.name`" :rules="rules.name">
<el-input type="text" placeholder="输入姓名" v-model="row.name"></el-input>
</el-form-item>
</template>
<template #default="{ row, $index }">
<el-form-item :prop="'tableData.'+$index+'.name'" :rules="rules.name">
<el-input type="text" placeholder="输入姓名" v-model="row.name"></el-input>
</el-form-item>
</template>
拼接也可以。