我想使用此代碼從我<paper-input-container>
獲取用戶輸入:無法將數據綁定到<input>高分子2.0
<paper-input-container id="nameInput">
<label slot="label">Your name</label>
<iron-input slot="input">
<input on-keydown="keypressed" value="{{first}}" id="nameBox">
</iron-input>
</paper-input-container>
在我properties
,我有:
static get properties() {
return {
first:{
type:String,
value:''
}
}
}
和我keypressed
功能是:
keypressed(e) {
console.log(this.first);
}
我已經能夠得到它與<paper-input>
元素一起工作,但我無法按照我想要的方式進行設計。如果您知道如何增加聚合物2.0中紙張輸入的用戶輸入文字大小,那也是有幫助的。
美麗的答案,真是幫了我,謝謝! –
@ L.Lasiter沒問題:) – tony19