微信小程序怎么获取用户输入内容
2018-04-27
导读:小程序获取用户输入内容,通过组件的属性 bindchange 将用户输入的储存存起来来实现。...
小程序获取用户输入内容,可以通过组件的属性 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
}
})
后台输出


第二部分:如何开通一个小商店
- 关注官方公众号 -


咨询电话:4006-089-731