<a-table rowKey="id" bordered
               :dataSource="dataSource"
               :columns="columns" :pagination="ipagination" :loading="loading" 			@change="handleTableChange">
              <span slot="serial" slot-scope="text,record,index">
               {{(ipagination.current-1)*ipagination.pageSize+index+1}}
              </span>
        <span slot="action" slot-scope="text, record">
          <a @click="assess(record)" v-if="!queryParam.hasAssess">考核</a>
          <span v-else>{{record.score}}</span>
        </span>
        <template slot="titleScore">
          <span v-if="queryParam.hasAssess">分数</span>
          <span v-else>操作</span>
        </template>
      </a-table>
columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 80,
            align: 'center',
            scopedSlots: { customRender: 'serial' },
            fixed: 'left'
          },
          {},
          {
            dataIndex: 'action',
            align: 'center',
            fixed: 'right',
            width: 100,
            scopedSlots: { customRender: 'action',title:'titleScore' }
          }
        ],

使用列的 scopedSlots 属性

scopedSlots: { customRender: ‘action’,title:‘titleScore’ }

Logo

前往低代码交流专区

更多推荐