1、
<a-table
ref="table"
bordered
:pagination="true"
:rowKey="(record) => record.id"
:data-source="onDutyList"
:columns="columnsTable"
class="charge-table"
size="middle"
>
</a-table>
borded : 显示所有的格格
pagination: 显示分页
2、
columnsTable: [
{
title: 'ID',
dataIndex: 'id',
width: '10px'
},
{
title: '试题',
dataIndex: 'title',
width: '150px'
},
{
title: '选项A',
dataIndex: 'chose_a',
width: '130px'
},
{
title: '选项B',
dataIndex: 'chose_b',
width: '130px'
},
{
title: '选项C',
dataIndex: 'chose_c',
width: '130px'
},
{
title: '选项D',
dataIndex: 'chose_d',
width: '130px'
},
{
title: '答案',
dataIndex: 'answer',
width: '40px'
}
],