0
我想在Polymer中創建一些紙張輸入。當單擊該項目旁邊的「計算」圖標時,它不會顯示紙張輸入的值或結果。它看起來在調用值(?)時出錯了,我不知道如何解決它?謝謝!聚合物1.0如何在推按鈕後顯示vaadin網格中的紙張輸入值?
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/iron-pages/iron-pages.html">
<link rel="import" href="../bower_components/iron-selector/iron-selector.html">
<link rel="import" href="shared-styles.html">
<link rel="import" href="../bower_components/paper-input/paper-input.html">
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/vaadin-grid/vaadin-grid.html">
<link rel="import" href="../bower_components/vaadin-date-picker/vaadin-date-picker.html">
<dom-module id="my-view2">
<template>
<style include="shared-styles">
:host {
display: block;
padding: 10px;
}
.form paper-icon-button{
left: 45%;
height: 120px;
width: 120px;
}
.form paper-input{
margin-left: 150px;
margin-right: 150px;
}
</style>
<div class="card">
<div class="form">
<paper-input type="number" name="satu" label="BLABLABLA1" value="{{todo.satu}}"></paper-input>
<paper-input type="number" name="dua"label="BLABLABLA2" value="{{todo.dua}}"></paper-input>
<paper-input type="number" name="tiga"label="BLABLABLA3" value="{{todo.tiga}}"></paper-input>
<paper-icon-button src="calculator.ico" on-tap="_addTodo"></paper-icon-button>
</div>
<vaadin-grid item="{todos}">
<table>
<colgroup>
<col name="satu">
<col name="dua">
<col name="tiga">
</colgroup>
</table>
</vaadin-grid>
</div>
</template>
<script>
Polymer({
is: 'my-view2',
properties: {
todo: {
type: Object,
value: function() {
return {};
}
},
todos: {
type: Array,
value: function() {
return [];
}
}
},
_addTodo: function() {
this.push('todos', this.todo);
this.todo = {};
}
});
</script>
</dom-module>
感謝您糾正代碼。我已將代碼更改爲'',但仍然是我的紙張輸入的colomn或值未顯示在頁面上。你可以幫我嗎? @KubaŠimonovský –
感謝您糾正代碼。我已將代碼更改爲'',但仍然是我的紙張輸入的colomn或值未顯示在頁面上。你可以幫我嗎? @KubaŠimonovský –
以下文檔中,您應該在'vaadin-grid'內使用'vaadin-grid-column'元素而不是'
相關問題