antd vue 树控件自动自定义展开收起图标(非数据渲染)
作者:互联网
<a-tree
show-icon
:icon="getIcon"
:tree-data="treeData"
>
</a-tree>
getIcon (props) {
const { expanded } = props
if (!props.children) {
return <a-icon class="file" type="file-text" />
}
return <a-icon type={expanded ? 'folder-open' : 'folder'} theme="filled" style="color: #ffbf00;" />
},
标签:控件,vue,return,自定义,expanded,props,folder 来源: https://blog.csdn.net/yrqlyq/article/details/121237881