elementui表单验证和表格共用

2020-03-20  本文已影响0人  noyanse

表格的list必须在表单的字段下面 prop用表格的list
form
form.list
:prop="list.${scope.$index}.object"

<el-form :model="createForm">
  <el-form-item label="条件">
    <el-table :data="createForm.conditionList">
      <el-table-column>
        <template slot-scope="scope">
          <el-form-item style="width:200px"
              :prop="`conditionList.${scope.$index}.object`"
              rules="[
                { required: true, message: '请选择对象', trigger: 'blur' },
              ]">

上一篇下一篇

猜你喜欢

热点阅读