zoukankan      html  css  js  c++  java
  • 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>
    
  • 相关阅读:
    爬虫之JSON
    爬虫bs4案例
    爬虫bs4
    爬虫之Xpath案例
    爬虫之xpath
    监控 Kubernetes 集群应用
    手动部署k8s-prometheus
    ingress之tls和path使用
    ingress安装配置
    kube-dns和coreDNS的使用
  • 原文地址:https://www.cnblogs.com/sllzhj/p/11738951.html
Copyright © 2011-2022 走看看