项目需求,官网这方面也不讲清楚
需求如下
方法:
fields:[
{
// title: 啦啦自定义,
dataIndex: 'name',
scopedSlots: { title: 'Title' },
width: '15%'
},
{
title: '名称',
dataIndex: 'age',
scopedSlots: { customRender: 'Content' },
width: '12%'
}
]
在表格配置数组中添加scopedSlots: { title: ‘Title’ }
然后在表格中添加
<a-table
rowKey="id"
:columns="fields"
:dataSource="loadData"
:pagination="null"
:loading="tableLoading"
@change="handleTableChange"
>
<template slot="Title" slot-scope="text,record">
在这里自定义表格标题
</template>
<template slot="Content" slot-scope="text,record">
在这里自定义表格内容
</template>
</a-table>
```
//其中 text就是dataindex,就是对应的数据,record是整行数据