Skip to content

Virtual Tree

虚拟树形组件

基础用法

基础的树形结构展示,传入 data 即可

vue




自定义节点内容

节点的内容支持自定义,可以在配置节点的内容和显示图标

vue




高阶自定义

支持虚拟树任意内容的自定义

vue






Props

prop说明类型默认值
data展示数据TreeData[]-
props配置选项Object-
defaultExpandedKeys默认展开的节点的 key 的数组string[][]
indent相邻级节点间的水平缩进,单位为像素Number16
currentNodeKey当前选中的节点String Number-
minSize自定义节点最小高度Number10
expandOnClickNode是否在点击节点的时候展开或者收缩节点Booleantrue

Slots

插槽名称说明参数
header顶部-
footer底部-
stickyFooter粘性底部-
stickyHeader粘性顶部-
icon图标-
content节点内容-
empty空态-

Events

事件名称说明回调参数
node-click当节点被点击的时候触发(data: TreeNodeData, node: ITreeNode, e: MouseEvent)
node-expand节点被展开时触发的事件(data: TreeNodeData, node: ITreeNode)
node-collapse节点被收起时触发的事件(data: TreeNodeData, node: ITreeNode)
current-change当前选中节点变化时触发的事件(data: TreeNodeData, node: ITreeNode)