ant-design-vue 中table简单用法

   <a-table 
    bordered  
    :columns="columns" 
    :data-source="data"
    :pagination="pagination">
  <template #action = {record,index}>
   .......//record 就表示表格里面某一行的的所有数据了
  </template>
</a-table> columns: [ { title: '姓名', dataIndex: 'name', key: 'name', }, { title: '年龄', dataIndex: 'age', key: 'age', }, { title: '住址', dataIndex: 'address', key: 'address',slots: {customRender:'action [自定义随便起]'} }, ], data: [ { key: '1', //这里需要加上 key 值,不然后报错 下面的data中 name 要与上面的dataIndex 相对应 若需要在表格中加上自定义的内容 则需要在 name: '胡彦斌', age: 32, address: '西湖区湖底公园1号', }, { key: '2', name: '胡彦祖', age: 42, address: '西湖区湖底公园1号', }, ],
原文地址:https://www.cnblogs.com/diligent-noob/p/14940506.html