需求是有一个el-table表格,el-table中有el-input, 要对el-input进行校验
解决:用el-form表单校验
html代码
html部分就是这样写,el-form表单包裹el-table
<el-form-item :prop=" 'tableData.' + scope.$index +'.school " :rules="rules.school">
好像编写规则就是这样 我还不太明白这段
<el-button @click="submit('tableForm')" >提交</el-button>
<el-form
:model="tableForm"
:rules="rules"
ref="tableForm"
>
<el-table
:data="tableForm.tableData"
>
<el-table-column
prop="school"
label="学校"
>
<template slot-scope="scope">
<el-form-item
**:prop=" 'tableData.' + scope.$index +'.school' "**
**:rules="