vue ant table 行号

尝试了多次,在customRender的函数中用不了this,用slot来代替解决了

html:

<a-table :columns="columns">
        <span slot="serial" slot-scope="text,record,index">
           {
    
    {
    
    (ipagination.current-1)*ipagination.pageSize+index+1}}
        </span>
      </a-table>

js :

columns: [
          {
    
    
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: "center",
            scopedSlots: {
    
    customRender: 'serial'}
          }
     
        ],

猜你喜欢

转载自blog.csdn.net/wyljz/article/details/106260271
今日推荐