聚合物3中的vaadin Combox
我有以下代码在聚合物3中使用vaadin组合框,但它不起作用。
<vaadin-combo-box id ="select" placeholder="Please select">
<template is="dom-repeat" items="{{items}}" as="item">
<option value$="{{item.id}}"> {{item.type}}</option>
</vaadin-combo-box>
我明白,它与此有关,否则,如果我只使用项目中的准确值,它就有效
I have following code to use vaadin combo box in polymer 3, but itis not working.
<vaadin-combo-box id ="select" placeholder="Please select">
<template is="dom-repeat" items="{{items}}" as="item">
<option value$="{{item.id}}"> {{item.type}}</option>
</vaadin-combo-box>
I understand, it has to do with and , else if I just use exact values in items, it works
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应将
模板
与dom-repeat
一起使用。有内部逻辑可以基于项目属性的vaadin-item
s填充弹出窗口(注意,它不使用option
),因此如果您执行You should not use
template
withdom-repeat
. There is internal logic that populates the popup withvaadin-item
's based on items property (note, it does not useoption
), so it should be enough if you do