AntDesign vue table中增加序号

AntDesign vue table中增加序号,可以使用customRender实现

AntDesign vue table中增加序号
customRender

参数分别为当前行的值,当前行数据,行索引

但我输出record,index,column都是undefined,最后发现index下标在text里

columns: [
        {
          title: '序号',
          width: '0.3rem',
          dataIndex: 'index',
          key: 'index',
          customRender: (text: any, record: any, index: any, column: any) => {
            return text.index + 1
          }
        }
]
index下标在text里
index下标在text里

最后效果

最后效果
最后效果

类似文章

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注