1.1.5 • Published 3 years ago

@aligov/tree v1.1.5

Weekly downloads
10
License
MIT
Repository
-
Last release
3 years ago

增强型树组件

@aligov/tree

支持搜索/编辑/删除等功能的树, 基于 Fusion Design Tree 组件深度定制。

API

Tree

其他功能 API 参考 Fusion Design 的 Tree 组件。

参数名说明必填类型默认值备注
onAdd添加按钮回调Function
onDelete删除按钮回调Function
onEdit编辑按钮回调Function
customIcons自定义IconArray[]
onCeXXXX自定义Icon 对应的点击回调Function

Datasource

基于 Fusion 的 官方 DataSource 进行拓展

{
    /* 官方参数不额外罗列 */
    label: "目录1",
    key: "xxx",
    hasAdd: true, // 控制 add 是否显示
    hasDelete: false, // 控制 delete 是否显示
    hasEdit: false, // 控制 edit 是否显示
    hasCeXXX: true, // 控制 customIcons 中自定义的 icon 是否显示
    children: [/* 子节点 */],
}

ICustomIcon

interface ICustomIcon {
  name: string;
  icon: string;
}

icon 参数为 fusion icon 的 type。

name 字段会先通过 pascal-case 转换一次, 再统一添加前缀 Ce(CustomIcons)以避免和其他参数冲突, 然后根据格式化以后的name 生成 hasCeXXX 和 onCeXXX 。

例如: showInfo => CeShowInfo => hasCeShowInfo/onCeShowInfo

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago