Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 解决 treeNodeModel 实例未能同步 node 属性的问题 #1535

Merged
merged 4 commits into from
Jul 18, 2023

Conversation

TabSpace
Copy link
Contributor

@TabSpace TabSpace commented Jul 17, 2023

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 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

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • ☑️ 文档已补充或无须补充
  • ☑️ 代码演示已提供或无须提供
  • ☑️ TypeScript 定义已补充或无须补充
  • ☑️ Changelog 已提供或无须提供

@xiaosansiji xiaosansiji merged commit a0550e9 into Tencent:develop Jul 18, 2023
6 checks passed
@TabSpace TabSpace deleted the fix/tree/node-model branch July 19, 2023 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants