Fil*_*ącz 6 javascript polymer polymer-1.0
我刚刚开始玩Polymer 1.0,我正在尝试对集合进行非常简单的绑定.我能够在dom-repeat中显示文本,但是对铁输入的双向绑定不起作用.我尝试了一系列字符串和对象.没运气.
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/iron-input/iron-input.html">
<dom-module id="hello-world">
<template>
<ul>
<template is="dom-repeat" items="{{data}}">
<li>{{item.value}}</li>
</template>
</ul>
<ul>
<template is="dom-repeat" items="{{data}}">
<li><input is="iron-input" bind-value="{{item.value}}"></input></li>
</template>
</ul>
</template>
</dom-module>
<script>
Polymer({
is: "hello-world",
ready: function() {
this.data = [
{ value: "Hello" },
{ value: "World!" }
];
}
});
</script>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3158 次 |
| 最近记录: |