原文来自:vue 修改ant中table表格的展开图标 树形表格expandIcon自定义图标
<template #expandIcon="props">
<span v-if="props.record.children?.length > 0">
<div
v-if="props.expanded"
style="display: inline-block; margin-right: 10px"
@click="
(e) => {
props.onExpand(props.record, e);
}
"
>
<DownOutlined />
</div>
<div
v-else
style="display: inline-block; margin-right: 10px"
@click="
(e) => {
props.onExpand(props.record, e);
}
"
>
<RightOutlined />
</div>
</span>
<span v-else style="margin-right:29px"></span>
</template>