miniprogram-demo/pages/component/form/form.js

46 lines
710 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Page({
onShareAppMessage() {
return {
title: 'form',
path: 'pages/component/form/form'
}
},
data: {
pickerHidden: true,
chosen: ''
},
pickerConfirm(e) {
this.setData({
pickerHidden: true
})
this.setData({
chosen: e.detail.value
})
},
pickerCancel() {
this.setData({
pickerHidden: true
})
},
pickerShow() {
this.setData({
pickerHidden: false
})
},
formSubmit(e) {
console.log('form发生了submit事件携带数据为', e.detail.value)
},
formReset(e) {
console.log('form发生了reset事件携带数据为', e.detail.value)
this.setData({
chosen: ''
})
}
})