Skip to content

[t-tree] tree.value.setItem({indeterminate: true}) 不生效 #5514

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

Open
vikyd opened this issue May 28, 2025 · 3 comments
Open

[t-tree] tree.value.setItem({indeterminate: true}) 不生效 #5514

vikyd opened this issue May 28, 2025 · 3 comments
Labels
🐞 bug Something isn't working 🧐 unconfirmed waiting to be confirmed

Comments

@vikyd
Copy link

vikyd commented May 28, 2025

tdesign-vue-next 版本

1.13.0

重现链接

https://stackblitz.com/edit/zvk1bwkn?file=package.json,src%2Fdemo.vue

重现步骤

点击【设置半选】按钮

期望结果

第一个节点应半选状态

实际结果

第一个节点没变成半选状态

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

@vikyd vikyd added 🐞 bug Something isn't working 🧐 unconfirmed waiting to be confirmed labels May 28, 2025
Copy link
Contributor

👋 @vikyd,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@vikyd
Copy link
Author

vikyd commented May 28, 2025

发现下面方式可以做到半选(而 setItem 形式则不行):

tree.value.getItem('node1').setData({
  indeterminate: true,
})

@QuentinHsu
Copy link
Collaborator

发现下面方式可以做到半选(而 setItem 形式则不行):

tree.value.getItem('node1').setData({
indeterminate: true,
})

可是你设置这样的“半选”是无意义的吧?因为要子节点总数大于 1 ,且存在至少 1 个子节点被选中,才符合通常理解的“半选”。🤔

Image

https://stackblitz.com/edit/zvk1bwkn-m8qaauz2?file=src%2Fdemo.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🧐 unconfirmed waiting to be confirmed
Projects
None yet
Development

No branches or pull requests

2 participants