We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bug 描述 参考文档里 VTree Data Fields 的说明,visible 为节点是否可见。 实际情况是 visible 为 false 时仍然显示到界面上。
复现步骤 隐藏节点无效:
上面的操作如果修改的是节点的 disabled 属性的话是生效的。
期望表现 设置 visible 为 true 时节点可见,设置 visible 为 false 时节点不可见。
实际表现 设置 visible 无效。
组件版本
The text was updated successfully, but these errors were encountered:
更新到 "@wsfe/vue-tree": "^4.1.1" 后,可以使用下面的方式隐藏和显示节点了,但是创建节点是 visible = false 的节点仍然会显示出来。
let vn: any; // 需要把 children 缓存起来,否则 n.visible = false 后 children 会被清空,比较奇怪的逻辑。 function toggleSystemTables(): void { for (const n of treeRef.value.getFlatData()) { if (n.title === 'information_schema') { console.log(n); // 隐藏之前缓存节点的 children。 if (n.visible) { vn = [...n.children] } // 隐藏节点。 n.isLeaf = false; n.visible = !n.visible; treeRef.value.updateNode(n.id, n); // 节点可见时重新更新 children。 if (n.visible) { treeRef.value.updateNode(n.id, { children: [...vn] }); } } } }
Sorry, something went wrong.
目的是根据条件动态的在需要的时候隐藏和显示节点,而不是删除节点。
No branches or pull requests
Bug 描述
参考文档里 VTree Data Fields 的说明,visible 为节点是否可见。
实际情况是 visible 为 false 时仍然显示到界面上。
复现步骤
隐藏节点无效:
上面的操作如果修改的是节点的 disabled 属性的话是生效的。
期望表现
设置 visible 为 true 时节点可见,设置 visible 为 false 时节点不可见。
实际表现
设置 visible 无效。
组件版本
The text was updated successfully, but these errors were encountered: