跳转到内容

SyncTree 同步树 数据容器

继承自 Tree 一次性获取全部数据,不会异步加载子节点数据,适用于权限树这类场景。

API

Tree API

参数说明类型默认值
searchable是否启用搜索框booleanfalse
iconFieldicon 对应的字段string-
checkedField是否选中对应的字段string-
searchable是否启用搜索框booleanfalse
depthLimit最大展开层级数(只在 treeData 时有效, 传 children 无效)number-

移除 props asyncLoadChildren

通用标签见: 容器通用标签

用法

基础用法
<View title="树形容器">
<SyncTree model="trantor_doc_Tree" parentField="parent" hasChildrenField="hasChildren">
<Fields>
<Field name="name"/>
</Fields>
</SyncTree>
</View>
操作
<View title="树形容器">
<SyncTree 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>
</SyncTree>
</View>