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號', }, ],

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM