跳转到内容

Tree

树容器,用于展示树形数据,获取数据为异步

API

参数说明类型默认值
hasChildrenField是否存在子节点字段名string-
condition过滤条件表达式string-
parentField父节点对应字段string-
onSelect选中行数据触发 Actionstring | function-
asyncLoadChildren是否异步加载子节点booleantrue
searchable是否启用搜索框booleantrue
checkedField是否选中对应的字段string-
iconFieldicon 对应的字段string-
dataSourceAction对应获取数据 Actionstring-
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>