简体   繁体   中英

Angular 2 Polymer Vaadin combo-box set value programatically

<vaadin-combo-box
             [items]="myValues"
             item-label-path="code"
             item-value-path="code"
             allow-custom-value="true"
></vaadin-combo-box>

I have a vaadin-combox-box element with a list of objects:

[ {code:'x', name:'y} ]

I want that when a user selects a value from the list, the displayed value to be the selected value + a suffix (eg: user selects value "apples" from drop down list and the displayed value is "apples-test".

您可以使用自定义项模板在下拉列表中显示其他值,而不是输入中显示的实际标签值: https//cdn.vaadin.com/vaadin-core-elements/master/vaadin-combo-box/演示/项目,template.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM