请问ant-design-vue如何把table和form结合做成表格内表单验证

<a-form-model
    ref="ruleForm"
    :model="dataSource[0]"
    :rule="rule">
    <a-table 
        :rowKey='(record,index)=>index'
        :customRow="exitCustomRow"
        :columns="columns"
        :data-source="dataSource"
        size="small">
        <span slot="serialNumber" slot-scope="text,record,index">
            {{index+1}}
        </span>
        <a-form-model-item
            slot="newApartId" 
            slot-scope="text, record">
            <a-input v-model="record.newApartId">
            </a-input>
        </a-form-model-item>
    </a-table>
</a-form-model>

exitCustomRow(record, index) {
    return {
        on:{
            click: event => {
                console.log(index)
            }
        }
    }
},

本来想着不断改变绑定的model做提示,但感觉这样的方法蠢,并且界面容易出错,请问各位大佬有什么结合的案例能给我参考一下吗

阅读 4.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题