效果:
1.
<a-table
:expandIcon="expandIcon"
:loading="loading"
:columns="columns"
:data-source="data"
class="components-table-demo-nested"
@change="onChangeTable"
:scroll="{x:1300,y:y}"
:pagination="pagination"
:locale="locale"
>
2.在方法methods下加入方法
expandIcon(props) {
// console.log(props);
if (props.record.fileInfoList.length > 0) {
if (props.expanded) {//有数据-展开时候图标
return (
<a
style="color: 'black',margin-right:0px"
onClick={(e) => {
props.onExpand(props.record, e);
}}
>
<a-icon type="down" />{" "}
</a>
);
} else {//有数据-未展开时候图标
return (
<a
style="color: 'black' ,margin-right:0px"
onClick={(e) => {
props.onExpand(props.record, e);
}}
>
<a-icon type="right" />
</a>
);
}
} else {//无数据-图标
return (
<span style="margin-right:0px">
<a-icon type="smile" />
</span>
);
}
},