1.1.0 • Published 7 years ago

zent-tree v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

zent-tree

Tree ui react component for zent

Zent Tree

文件夹、组织架构、生物分类、国家地区等等,世间万物的大多数结构都是树形结构。使用树控件可以完整展现其中的层级关系,并具有展开收起选择等交互功能。

Tree相关属性

参数说明类型默认值备选值
dataType数据类型,默认为tree类型string'tree''plain'
data实际传入的数据(必填),根据dataType进行识别array必填
render自定义树条目渲染方法,传入参数为该节点数据(包含子树)function(data)null
operations自定义操作,包含name、icon、action、shouldRender属性arrayobjectnull
foldable是否支持点击条目时展开与收起动作,默认为truebooltrue
checkable是否支持checkbox选择,默认为falsebooltrue
onCheck点击checkbox的回调函数,传入包含所有点击节点id数组function(data)null
defaultCheckedKeys默认选中节点id数组arraynull
disabledCheckedKeys默认禁选节点id数组arraynull
size大小string'medium'
commonStyle设置整个tree的外层styleobjectnull'small'、'large'
expandAll是否展开所有节点boolfalsetrue
onExpand展开节点之后的回调函数function(data, config)null
autoExpandOnSelect点击节点是否展开booltrue
onSelect选择树的一个节点的回调函数function(data, target)null
isRootplain数据类型,判断节点是否为根节点的apifunction(node)null

data包含字段(可自由扩展其他字段)

参数说明类型默认值备选值
id必填,数据的唯一标识number/string必填
title显示内容string必填
children子树(dataType="tree"生效)arrayobjectnull
parentId父节点Id(dataType="plain"生效),根节点为0或不定义number/stringnull
expand是否展开boolfalsetrue
isLeaf是否叶子节点boolfalsetrue

operations包含字段

参数说明类型默认值备选值
name显示内容string必填
icon显示icon的classNamestringnull
action点击回调函数,参数为子树信息function(data)必填
shouldRender是否更新,返回true/falsefunction(data)null
1.1.0

7 years ago

1.1.0-beta5

7 years ago

1.1.0-beta4

7 years ago

1.1.0-beta1

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.8-beta2

7 years ago

1.0.8-beta1

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago