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

tree-select绑定的是key值,而不是value值 #8706

Open
yjq635 opened this issue Aug 23, 2024 · 2 comments
Open

tree-select绑定的是key值,而不是value值 #8706

yjq635 opened this issue Aug 23, 2024 · 2 comments
Assignees

Comments

@yjq635
Copy link

yjq635 commented Aug 23, 2024

Reproduction link

https://stackblitz.com/edit/angular-oudzoz?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce

树形选项选中节点,页面显示绑定值

What is expected?

显示node的value值

What is actually happening?

显示node的key值

Environment Info
ng-zorro-antd 18.1.1
Browser chrome
Copy link

zorro-bot bot commented Aug 23, 2024

Translation of this issue:

TREE-SELECT is bound to the key value, not the value value

REPRODUCTION LINK

[https://stackblitz.com/edit/angular- means-organdzoz?file=src%2FApp.com p%2FAPP. Component.ts)

STEPS To Reproduce

Tree options Select the node, page display binding value

What is exfected?

Display the value value of Node

What is actually happy?

Show the key value of node

| ENVIRONMENT | Info |
| --- | --- | |
| NG-Zorro-ATD | 18.1.1 |
| Browser | Chrome |

@yjq635
Copy link
Author

yjq635 commented Aug 23, 2024

取key字段值的问题是 nzExpandedKeys的类型是string[],从而导致key的值只能是string类型,
目前我给key绑定实际值(number类型) 且nzExpandedKeys 设置为nuber[] 也可以,只是模板有类型错误提示

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants