我正在尝试在 dom-repeater 和模板中的输入之间创建双向数据绑定,但更改似乎不会传播回来。我究竟做错了什么?
<dom-module id="record-card">
<template id="node">
<template is="dom-repeat" items="{{labels}}">
<h1>
<input is="iron-input" bind-value="{{item}}" on-change="labelsChanged">
</h1>
</template>
<input is="iron-input" bind-value="{{labels.0}}">
Labels: <span>{{labels}}</span>
</template>
</dom-module>
<script>
Polymer({
is: "record-card",
properties: {
labels: {
type: Array,
notify: true,
value: function() {
return ["Pizza", "Person"]
}
}
}
});
</script>
dom 中继器中的输入不会传播,它外部的输入使用路径传播到中继器,但不是相反,但它不会更新{{}}
.