Tree
树容器,用于展示树形数据,获取数据为异步
API
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| hasChildrenField | 是否存在子节点字段名 | string | - |
| condition | 过滤条件表达式 | string | - |
| parentField | 父节点对应字段 | string | - |
| onSelect | 选中行数据触发 Action | string | function | - |
| asyncLoadChildren | 是否异步加载子节点 | boolean | true |
| searchable | 是否启用搜索框 | boolean | true |
| checkedField | 是否选中对应的字段 | string | - |
| iconField | icon 对应的字段 | string | - |
| dataSourceAction | 对应获取数据 Action | string | - |
| depthLimit | 最大展开层级数(只在 treeData 时有效, 传 children 无效) | number | - |
通用标签见: 容器通用标签
用法
基础用法
<View title="树形容器"> <Tree model="trantor_doc_Tree" parentField="parent" hasChildrenField="hasChildren"> <Fields> <Field name="name"/> </Fields> </Tree></View>操作
<View title="树形容器"> <Tree model="trantor_doc_Tree" parentField="parent" hasChildrenField="hasChildren" @onSelect="handlerSelect"> <Fields> <Field name="name"/> </Fields> <RecordActions> <Action label="编辑" action="trantor_doc_Tree_update" /> <Action label="删除" action="trantor_doc_Tree_delete" after="Refresh" /> </RecordActions> </Tree></View>