• 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>
    
  • 相关阅读:
    html$css_day05
    html$css_day04
    html$css_day03
    html$css_day02
    html$css_day01
    日常笔记19/3/04-19/3/10
    堆排序
    js对象之XMLHttpReques对象学习
    前端页面显示问题解决步骤(方法)
    SpringBoot跨域小结
  • 原文地址:https://www.cnblogs.com/sllzhj/p/11738951.html
Copyright © 2020-2023  润新知