DevCloudFE / ng-devui

Angular UI Component Library based on DevUI Design
https://devui.design
MIT License
1.75k stars 210 forks source link

✨ [Feature]: #264

Open bouyeijiang opened 2 years ago

bouyeijiang commented 2 years ago

What problem does this feature solve

tree控件在构造函数的后台请求数据后赋值树结构没有刷新如何解决,求解?

What does the proposed API look like

<d-operable-tree

operableTree

  [tree]="dataSource"
  [iconParentOpen]="iconParentOpen"
  [iconParentClose]="iconParentClose"
  [iconTemplatePosition]="'after-checkbox'"
  [disableMouseEvent]="disableMouseEvent"
> 

动态修改dataSource值没有刷新

Simplelegant commented 2 years ago

确认下数据是否完成变更,数据变更无误的话尝试下解构赋值

bouyeijiang commented 2 years ago

数据没问题,直接吧数据贴到ts里面就正常,貌似直接修改dataSource不能动态更新,也找到不可以重新加载树的方法,只能用basicTree.treeFactory.mapTreeItems方法临时解决了

kagol commented 2 years ago

@bouyeijiang 谢谢你的反馈,希望issue的标题能更完善一些