注册登录

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

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
    }
}) 后台输出 微信小程序怎么获取用户输入内容

电话咨询 微信咨询 预约演示 0元开店