微信小程序怎么获取用户输入

能够获取用户输入的组件,需要使用组件的属性bindchange将用户的输入内容同步到 AppService。

<input id="myInput" bindchange="bindChange" />
<checkbox id="myCheckbox" bindchange="bindChange" />
var inputContent = {}

Page({
  data: {
    inputContent: {}
  },
    bindChange: function(e) {
        inputContent[e.currentTarget.id] = e.detail.value
    }
})
微信小程序应用号交流 563752274
posted @ 2016-09-27 21:47  DragonDean  阅读(14986)  评论(0编辑  收藏  举报
CopyRight (C) 2014 By:DreagonDean 小程序公众号开发交流群:294322801