<a-table
:columns="columns"
:data-source="data"
>
<!-- 表头自定义 -->
<span slot="customName" style="color: #ff6b81"
><a-icon type="smile-o" /> 订单状态配载状态</span
>
</a-table>
let colums = [
{
dataIndex: 'no',
key: 'no',
title: '客户名称',
scopedSlots: { customRender: 'time' }
},
{
dataIndex: 'time',
key: '配载单状态',
<!-- 表头自定义 -->
slots: { title: 'customName' },
scopedSlots: { customRender: 'time'
}
]
效果
第二种:
<a-table
:columns="columns"
:data-source="data"
>
</a-table>
let colums = [
{
dataIndex: 'no',
key: 'no',
title: 'S/O NO',
scopedSlots: { customRender: 'time' }
},
{
dataIndex: 'time',
key: '配载单状态',
title: '客户名称',
scopedSlots: { customRender: 'time'
}
]
在vue js引入后,然后个别title值
比如
export default {
data() {
let getColumns = colums
getColumns[1].title = (
<div class="second-header">
<p>客户简称</p>
<p>客户编码</p>
</div>
)
return {
columns: getColumns ,
}
}
}
效果