ant design vue table 中的额外展开行的expandIcon替换
·
<a-table
bordered
:key="tableKey"
:rowKey="
(record) => {
return record.id
}
"
:columns="referenceColumns"
:data-source="referenceList"
:loading="loading"
:pagination="pagination"
:expandIcon="expandIcon"
@change="(current) => this.listenSizeChange(current)"
>
<p
slot="expandedRowRender"
slot-scope="record"
>
{{ record.content }}
</p>
</a-table>
注意:expandIcon="expandIcon", 其中expandIcon需要在methods中定义
expandIcon(props) {
if (props.expanded) {
return (
<a-icon
title="点击关闭详细"
type="minus"
onClick={(e) => {
props.onExpand(props.record, e);
}}
/>
);
} else {
return (
<a-icon
title="点击查看详细"
type="plus"
onClick={(e) => {
props.onExpand(props.record, e);
}}
/>
);
}
},
更多推荐



所有评论(0)