当点击 <form>
表单中 formType 为 submit 的 <button>
组件时,会将表单组件中的 value 值进行提交,需要在表单组件中加上 name 来作为 key。
示例
export default {
data() {
return {
chosen: ''
}
},
methods: {
this.pickerHidden = true
this.chosen = e.target.value
},
pickerCancel: function(e) {
this.pickerHidden = true
pickerShow: function(e) {
this.pickerHidden = false
formSubmit: function(e) {
console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value))
},
formReset: function(e) {
console.log('清空数据')
this.chosen = ''
}
tips
- 有表单校验插件