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? 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
tree组件同时使用render-prefix和on-update:expanded-keys渲染前缀时后者不生效,由于并不希望在数据部分写prefix,所以要用到render-prefix,但同时希望在展开时切换图标,此时on-update:expanded-keys绑定的函数切换图标不生效。或者说有什么技巧能解决我现在的需求,谢谢告知。
const updatePrefixWithExpaned = ( _keys: Array<string | number>, _option: Array<TreeOption | null>, meta: { node: TreeOption | null; action: 'expand' | 'collapse' | 'filter'; } ) => { if (!meta.node) return; switch (meta.action) { case 'expand': console.log('ex'); meta.node.prefix = () => h(NIcon, null, { default: () => h(FolderOpenOutline) }); break; case 'collapse': meta.node.prefix = () => h(NIcon, null, { default: () => h(Folder) }); break; } }; const renderPrefix = ({ option, checked, selected }: { option: TreeOption; checked: boolean; selected: boolean; }) => { if (option.children && option.children.length > 0) return h(NIcon, null, { default: () => h(Folder) }); return h(NIcon, null, { default: () => h(FileTrayFullOutline) }); };
无
yarn
The text was updated successfully, but these errors were encountered:
请提供一个在线的最小复现链接
Sorry, something went wrong.
没发现问题 https://codesandbox.io/p/sandbox/fervent-sutherland-fsmgmg?file=%2Fsrc%2FDemo.vue%3A10%2C35
https://codesandbox.io/p/sandbox/wonderful-tree-3g9jv9 如这个例子这里: 但期望的效果应该像官方文档那样文件夹图标切换为打开状态:
同时使用确实不行,update:expand-keys 事件在 render-prefix 之前触发的 只能把 render-prefix 改成在数据层面构造 prefix
update:expand-keys
render-prefix
feat(tree): batch render method adds node info expanded, closes tus…
expanded
cb63536
…en-ai#5865
Successfully merging a pull request may close this issue.
Describe the bug
tree组件同时使用render-prefix和on-update:expanded-keys渲染前缀时后者不生效,由于并不希望在数据部分写prefix,所以要用到render-prefix,但同时希望在展开时切换图标,此时on-update:expanded-keys绑定的函数切换图标不生效。或者说有什么技巧能解决我现在的需求,谢谢告知。
Steps to reproduce
Link to minimal reproduction
无
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: