1、 form表单取值
1.1 方式一,通过<form bindsubmit="formSubmit">与<button formType="submit">标签配合使用
formSubmit: function(e) {
// detail
var detail = e.detail.value.detail;
// realname
var realname = e.detail.value.realname;
// mobile
var mobile = e.detail.value.mobile;
}
2、方式二,通过<input bindblur="realnameConfirm">实现:失去焦点bindblur、数值变化bindchange等方法
realnameConfirm: function(e) {
var that = this;
that.setData({
realname:e.detail.value
})
}
转载于:https://www.cnblogs.com/diony/p/9086976.html