Closed danranVm closed 3 years ago
Name | Description | Type | defaults | Global | Notes |
---|---|---|---|---|---|
V-model: checkedKeys |
check the box nodekey array |
(string \ | number) [] |
- | - | - |
V-model: expandedRowKeys |
Expandkey array of nodes |
(string \ | number) [] |
- | - | - |
V-model: selectedRowKeys |
key array of selected nodes |
(string \ | number) [] |
- | - | - |
Block |
nodes entire row distraction | boolean |
false |
✅ | - |
Checkable |
the selection box configuration items, see [TreeCheckable] (# TreeCheckable) | TreeCheckable |
- | - | - |
ChildrenKey |
key designated tree structure |
string |
children |
- | - |
DataSource |
tree data array | object [] |
- | - | - |
Related item drop functionality, see [TreeDraggable] (# TreeDraggable) | draggable`` TreeDraggable |
- | - | - | |
Empty |
contents when empty data | string \ | EmptyProps \ | # empty |
- | - | - |
Expandable |
expanded configuration items related functions, see [TreeExpandable] (# TreeExpandable) | TreeExpandable |
- | - | - |
Height |
set up a virtual scroll container height | number |
- | - | - |
NodeKey |
nodekey values |
string \ | record => string \ | number |
key |
✅ | - |
Related item selection function, see [TreeSelectable] (# TreeSelectable) | selectable`` TreeSelectable |
- | - | - | |
ShowLine |
whether cable | boolean |
false |
✅ | - |
UseVirtual |
whether to open the virtual scroll | boolean |
false |
- | need to setheight |
OnNodeClick |
node click event | (evt: Event, node: T) => void |
- | - | - |
OnNodeContextmenu |
node right click event | (evt: Event, node: T) => void |
- | - | - |
Name | Description | Type | defaults | Global | Notes |
---|---|---|---|---|---|
Disabled |
disabled node | boolean \ | {checkable: boolean, expandable: boolean, draggable: boolean, droppable: boolean} |
- | - | istrue , higher priority than TreeProps |
IsLeaf |
to leaf nodes | boolean |
- | - | will force its parent node, with the loadChildren used asfalse |
Text nodes | label`` string |
- | - | - | |
Prefix |
prefix icon | string |
- | - | - |
Suffix |
suffix icon | string |
- | - | - |
Name | Description | Type | defaults | Global | Notes |
---|---|---|---|---|---|
Disabled |
set whether to allow check node selection box | (node: T) => boolean |
- | - | - |
OnChange |
triggered when selecting check box status changes | (checkedKeys: (string \ | number) [], checkedNodes: T []) => void |
- | - | - |
OnCheck |
triggered when selecting check box status changes | (checked: boolean, node: T) => void |
- | - | - |
Name | Description | Type | defaults | Global | Notes |
---|---|---|---|---|---|
Disabled |
node is arranged to allow a drag | (node: T) => boolean |
- | - | - |
Droppable |
drag, if allowed to stand at the node | ({dropNode, dropPosition}) => boolean |
- | - | - |
OnDragStart |
called whendragstart trigger |
(evt: DragEvent, node: T) => void |
- | - | - |
OnDragEnd |
called whendragend trigger |
(evt: DragEvent, node: T) => void |
- | - | - |
OnDragEnter |
called whendragenter trigger |
(evt: DragEvent, node: T) => void |
- | - | - |
OnDragLeave |
called whendragleave trigger |
(evt: DragEvent, node: T) => void |
- | - | - |
OnDragOver |
called whendragover trigger |
(evt: DragEvent, node: T) => void |
- | - | - |
OnDrop |
called whendrop trigger |
(evt: DragEvent, node: T) => void |
- | - | - |
Name | Description | Type | defaults | Global | Notes | |
---|---|---|---|---|---|---|
Disabled |
Settings node whether to allow expanded | (node: T) => boolean |
- | - | - | |
Icon |
Expand icon | string |
right |
✅ | - | |
LoadChildren |
loads the child node data | (node: T) => Promise <T []> |
- | - | - | |
Key already loaded nodes |
loadedKeys (string \ | number) [] |
- | - | - | ||
OnChange |
trigger state changes unfold | (expendedKeys: (string \ | number) [], expendedNodes: T []) => void |
- | - | - | |
OnExpand |
Click to trigger the expand icon | (expanded: boolean, node: T) => void |
- | - | - | |
OnLoaded |
triggered when a child node is loaded | (node: T, loadedKeys: (string \ | number) []) => void |
- | - | - |
Name | Description | Type | defaults | Global | Notes |
---|---|---|---|---|---|
Disabled |
provided to select whether to allow the node | (node: T) => boolean |
- | - | - |
Multiple |
supports multiple choice | boolean |
true |
- | - |
OnChange |
triggered when selected changes | (selectedKeys: (string \ | number) [], selectedNodes: T []) => void |
- | - | - |
OnSelect |
triggered when selected changes | (selected: boolean, node: T) => void |
- | - | - |
Name | Description | Parameter Type | Notes |
---|---|---|---|
ExpandIcon |
Customize expand icon | {key: string \ | number, expanded: boolean, node: TreeNode} |
- |
Label |
custom text node | {node: TreeNode} |
- |
Prefix |
icon from prefix defined nodes | {key: string \ | number, checked: boolean, expanded: boolean, selected: boolean, node: TreeNode} |
- |
Suffix |
self-defined icons suffix node | {key: string \ | number, checked: boolean, expanded: boolean, selected: boolean, node: TreeNode} |
- |
Name | Description | Parameter Type | Notes |
---|---|---|---|
ScrollTo |
virtual scroll, scroll to the specified location | (value ?: number | ScrollToConfig) => void |
- |
What problem does this feature solve?
What does the proposed API look like?
IxTree
TreeProps
v-model:checkedKeys
key
数组(string \| number)[]
v-model:expandedRowKeys
key
数组(string \| number)[]
v-model:selectedRowKeys
key
数组(string \| number)[]
block
boolean
false
checkable
TreeCheckable
childrenKey
key
string
children
dataSource
object[]
draggable
TreeDraggable
droppable
TreeDroppable
empty
string \| EmptyProps \| #empty
expandable
TreeExpandable
height
number
nodeKey
key
的取值string \| record => string \| number
key
selectable
TreeSelectable
showLine
boolean
false
useVirtual
boolean
false
height
onNodeClick
(evt: Event, node: TreeNode) => void
onNodeContextmenu
(evt: Event, node: TreeNode) => void
TreeNode
additional
object
class
,style
或者其他属性children
TreeNode[]
disabled
boolean \| { checkable: boolean, expandable: boolean, draggable: boolean, droppable: boolean}
true
时,优先级高于TreeProps
isLeaf
boolean
false
时会强制将其作为父节点,配合loadChildren
使用key
string \| number
TreeProps
中的nodeKey
设置唯一值label
string
prefix
string
suffix
string
TreeCheckable
disabled
(node: TreeNode) => boolean
onChange
(checkedKeys: (string \| number)[], checkedNodes: TreeNode[]) => void
onCheck
(checked: boolean, node: TreeNode) => void
TreeDraggable
disabled
(node: TreeNode) => boolean
onDragStart
dragstart
触发时调用(evt: DragEvent, node: TreeNode) => void
onDragEnd
dragend
触发时调用(evt: DragEvent, node: TreeNode) => void
onDragEnter
dragenter
触发时调用(evt: DragEvent, node: TreeNode) => void
onDragLeave
dragleave
触发时调用(evt: DragEvent, node: TreeNode) => void
onDragOver
dragover
触发时调用(evt: DragEvent, node: TreeNode) => void
TreeDroppable
disabled
(options: TreeDropOptions) => boolean
onDrop
drop
触发时调用(evt: DragEvent, options: TreeDropOptions) => void
TreeExpandable
disabled
(node: TreeNode) => boolean
icon
string
right
loadChildren
(node: TreeNode) => Promise<TreeNode[]>
loadedKeys
key
(string \| number)[]
onChange
(expendedKeys: (string \| number)[], expendedNodes: TreeNode[]) => void
onExpand
(expanded: boolean, node: TreeNode) => void
onLoaded
(node: TreeNode, loadedKeys: (string \| number)[]) => void
TreeSelectable
disabled
(node: TreeNode) => boolean
multiple
boolean
true
onChange
(selectedKeys: (string \| number)[], selectedNodes: TreeNode[]) => void
onSelect
(selected: boolean, node: TreeNode) => void
TreeSlots
expandIcon
{key: string \| number, expanded: boolean, node: TreeNode}
label
{node: TreeNode}
prefix
{key: string \| number, checked: boolean, expanded: boolean, selected: boolean, node: TreeNode}
suffix
{key: string \| number, checked: boolean, expanded: boolean, selected: boolean, node: TreeNode}
TreeMethods
scrollTo
(value?: number \| ScrollToConfig) => void