<a-form-item label="切换环境">
<a-select
v-decorator="[
'env',
{ rules: [{ required: true, message: '该字段是必填字段' }] }
]"
placeholder="请选择环境"
>
<a-select-option value="dev">dev</a-select-option>
<a-select-option value="test">test</a-select-option>
<a-select-option value="staging">staging</a-select-option>
</a-select>
</a-form-item>
env就是绑定的值
如何查看 from 中绑定的表单数据?
data() {
return {
form: this.$form.createForm(this, { name: 'coordinated' })
}
},
methods: {
handleSubmit(e) {
e.preventDefault()
this.form.validateFields(async (err, values) => {
const checkMailParams = { ...values }
delete checkMailParams.env
if (!err) {
const { response } = await CheckMailBox(checkMailParams)
if (response) {
this.text = response
} else {
this.$message.error(`请求异常`, 2)
}
}
})
},
const checkMailParams = { ...values }
delete checkMailParams.env