fix: 解决 treeNodeModel 实例未能同步 node 属性的问题 #1535
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 这个 PR 的性质是?
🔗 相关 Issue
解决 treeNodeModel 实例未能同步 node 属性的问题。
进行了小幅度的性能改进。
💡 需求背景和解决方案
问题: treeNodeModel 实例未能同步 node 属性,取得 treeNodeModel 之后,如果更改了 treeNode 的状态,读取原 treeNodeModel 实例的 visible, checked 等属性时,拿到的还是之前取值时的状态。
解决方式: 这类属性改为使用 public get 方式定义,变为取值方式,可确保之后即使用户自行缓存了 treeNodeModel 节点,也能拿到同步的属性。
📝 更新日志
fix(tree): 解决 treeNodeModel 实例未能同步 node 属性的问题
refactor(tree): 用 nextTick 机制替换了 timeout 延时,来检查 tree 结构,并触发更新事件。
perf(tree): 设置 store 选项时,仅更新节点状态,不更新节点选中态,减少计算量。
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单