今天客户想下载表头的标题,就研究了下title里面重新定义样式属性
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-table
ref="table"
:columns="columns"
:dataSource="data"
:alert="true"
:rowKey="(record) => record.id"
:pagination="false"
:defaultExpandAllRows="true"
:loading="loading"
showPagination="auto">
<span slot="title_slot" >字段名称<a @click="ExpoortData">(下载)</a></a-tooltip>
</span>
</a-table>
</a-form-item>
</a-form>
</a-spin>
export default {
name:"DetailForm",
data () {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 8 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
},
visible: false,
confirmLoading: false,
ttitle:"",
form: this.$form.createForm(this),
datarowsource:{},
columns: [
{
//title: '字段名称',
align: 'center',
dataIndex: 'dataRName',
scopedSlots: {title:"title_slot",customRender: 'content_slot'}
},
大致的案例就是以上,本人已测试过可使用