vue antd table title 动态修改
<a-table rowKey="id" bordered:dataSource="dataSource":columns="columns" :pagination="ipagination" :loading="loading"@change="handleTableChange"><span slot="serial" slot-scope="text,record,ind
·
<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’ }
更多推荐
已为社区贡献11条内容
所有评论(0)