【发布时间】:2016-05-31 19:16:07
【问题描述】:
我是 Polymer 的新手,我正在尝试使用 vaadin' 组合框构建应用程序,但从未触发 value-changed 事件...
在我的 html 中,我有:
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/vaadin-combo-box/vaadin-combo-box.html">
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
<dom-module id="fast-purchase-data">
<template>
<iron-ajax id="placesListAjax" url="../mock-responses/places.json" last-response="{{places}}"></iron-ajax>
<vaadin-combo-box value-changed="valueChange" label="Places" class="combobox elements-box" items="[[places.data.elements]]" item-label-path="name"></vaadin-combo-box>
<iron-ajax id="eventsListAjax" url="../mock-responses/events-list.json" last-response="{{resp}}" auto></iron-ajax>
<vaadin-combo-box value-changed="valueChange" label="Events" class="combobox" items="[[resp.data.elements]]" item-label-path="name"></vaadin-combo-box>
</template>
<script>
(function() {
'use strict';
Polymer({
is: 'fast-purchase-data',
valueChange: function(ev, i){
console.log("hey");
},
_pageChanged: function() {
this.$.placesListAjax.generateRequest();
},
});
})();
</script>
</dom-module>
我可以在我的组合框中看到数据,但是当我更改它的值时,我看不到 console.log 也没有错误。我错过了什么?
【问题讨论】: