table中的树形结构

  • Post author:
  • Post category:其他


1、row-key 必填 最好给数字或唯一属性 , 给每个节点设置id 不填的话 没有办法实现展开效果 ***(重要)

2、load 这个是动态添加数据的 前提(开启lazy ,表格数组里设置了hasChildren:true)

3、treeprops 是配置树状收缩数据的

4、treeprops :{hasChildren} 是否可收缩(一般配合lazy使用)

5、treeprops :{children} 展开的子项

总而言之 ,row-key是必须要的(开启children),无论是加载性能还是标识都一定要唯一的, tabledata 表格数据里的 children:[ {‘数据’}]子项和hasChildren:true 尽量不要同时存在,因为children 是默认的效果, 如果在tabledata里设置hasChildren:true 那么就要配合load 函数 进行动态加入数据的效果,



版权声明:本文为weixin_57128623原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。