IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    antdui vue a-table 序号功能

    zongyan86发表于 2023-01-05 01:59:59
    love 0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    前端
    template:
     columns: [
            {
              title: '序号',
              width: '60px',
              required: true,
              dataIndex: 'no',
              scopedSlots: { customRender: 'no' },
              align: 'center',
              ellipsis: true,
            }]

    <div slot="no" slot-scope="text, record, index">
         {{ (pagination.page - 1) * pagination.pageSize + index + 1 }}
    </div>

    data:
    pagination: {
            pageSize: 10,
            ...pagination
    },

    后端请求:
    this.pagination = Object.assign({}, this.pagination, {
        page: data?.page,
        pageSize: data?.size,
        total: data?.total,
        current: data?.page
    });

    声明: 本文采用 BY-NC-SA 协议进行授权 | WEB开发分享
    转载请注明转自《antdui vue a-table 序号功能》



沪ICP备19023445号-2号
友情链接