-
Notifications
You must be signed in to change notification settings - Fork 45
怎么只更新某一个节点的样式? #61
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
Comments
如果你要把非叶子节点变成叶子节点,把它底下的所有子节点都删除可以吗,调用 |
谢谢回复,其实这只是一个例子,因为还有不少情况需要更新某个指定节点的样式,例如修改某个属性值,节点的样式要更新。 |
节点数据变化了,调用 tree.value.clearChecked() 强制更新节点样式。 ^3.1.0 的时候 tree.value.clearChecked() 这个方法还能勉强实现这个功能,但是 ^3.2.0 后这个功能失效了。 问题: 有没有办法在修改节点的数据 node.title = 'foo' 后,更新这个节点呢? |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用
setData()
的方式设置树的数据 (使用非响应式):node.isLeaf
为 false,有小三角形箭头。node.isLeaf = true
把节点修改为叶子节点,节点的样式没有变,即小三角形箭头还在。tree.value.clearChecked()
强制更新整棵树,这时 node 的小三角形箭头消失。有没有更好的方法,只更新某个节点的样式?
The text was updated successfully, but these errors were encountered: