위챗 애플릿-form 양식 - 사용자가 입력한 텍스트 상자의 값을 가져옵니다.
5278 단어 기타 분류
//
nickname: function(e) {
this.setData({
nickname: e.detail.value,
})
console.log(" " + this.data.nickname);
},
//
realName: function(e) {
this.setData({
realName: e.detail.value,
})
console.log(" " + this.data.realName);
},
//
detailAddress: function(e) {
this.setData({
detailAddress: e.detail.value,
})
console.log(" " + this.data.detailAddress);
this.setData({
detailAddress: e.detail.value,
})
console.log(" " + this.data.detailAddress);
},
baocun: function(e) {
console.log(" :" + this.data.nickname + " :" + this.data.realName + " :" + this.data.sex + " " + this.data.detailAddress);
},
data: {
userName: '',
userPwd:""
},
//
userNameInput:function(e)
{
this.setData({
userName: e.detail.value
})
},
passWdInput:function(e)
{
this.setData({
userPwd: e.detail.value
})
},
//
loginBtnClick: function (e) {
console.log(" :"+this.data.userName+" :" +this.data.password);
}
폼
formSubmit: function (e) {
console.log('form submit , :', e.detail.value);
},
let app = getApp();
Page({
data: {
phone: "",
pwd: "",
sex: " "
},
formSubmit: function (e) {
console.log('form submit , :', e.detail.value);
let { phone, pwd, isPub, sex } = e.detail.value;
this.setData({
warn: "",
isSubmit: true,
phone,
pwd,
isPub,
sex
})
},
formReset: function () {
console.log('form reset ')
}
})