NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.85k stars 3.9k forks source link

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

Open yjq635 opened 3 weeks ago

yjq635 commented 3 weeks ago

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
zorro-bot[bot] commented 3 weeks ago

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 commented 3 weeks ago

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