ant design for vue 关于table的一些问题

 

1、为table添加分页: :pagination="pagination"

pagination: {
      defaultPageSize: 10,
      showTotal: (total) => `共${total} 条数据`,
      total: 0,
      showSizeChanger: true,
      pageSizeOptions: ['10', '20', '50'],
      onShowSizeChange: (current, pageSize) => {
        this.pageSize = pageSize;
        this.getTableData();
      },
      onChange: (page, pageSize) => {
        this.pageSize = pageSize;
        this.pageNum = page;
        this.getTableData();
      }

    },

2、为table添加序号:在columns中: 添加一行:  {"title": "序号",customRender: (value, row, index) => `${(this.pageNum-1)*10+index+1}`},
	/**pageNum 当前第几页*/

3、 为table添加编辑、删除功能
	<template slot="sensorId" slot-scope="text, record, index">
	    <span>
	      <a-button @click.native="editTableRow(record)" size="small" type="link">编辑</a-button>
	      <a-button @click.native="removeTableRow(record)" size="small" type="link">删除</a-button>
	    </span>
	</template>

 

上一篇:CI(6)


下一篇:CrystalReport父子报表实例