微信小程序怎么獲取用戶輸入內(nèi)容
2018-04-27
導讀:小程序獲取用戶輸入內(nèi)容,通過組件的屬性 bindchange 將用戶輸入的儲存存起來來實現(xiàn)。...
小程序獲取用戶輸入內(nèi)容,可以通過組件的屬性 bindchange 將用戶輸入的儲存存起來
test.wxml
<input id="postalCode" bindchange="bindChange" type="number" placeholder="輸入郵政編碼" auto-focus />
<input id="mail" bindchange="bindChange" type="number" placeholder="請輸入郵箱地址" />
test.js
var inputContent = {}
Page({
data: {
inputContent: {}
},
bindChange: function(e) {
inputContent[e.currentTarget.id] = e.detail.value
}
})
后臺輸出


第二部分:如何開通一個小商店
您可能感興趣: 小程序開發(fā)
- 關(guān)注官方公眾號 -


咨詢電話:4006-089-731