是ElementPlus的Form里如果仅有一个input,则默认会在回车时提交表单。
tip W3C 标准中有如下规定:
When there is only one single-line text input field in a form, the user agent should accept Enter in that field as a request to submit the form.
即:当一个 form 元素中只有一个输入框时,在该输入框中按下回车应提交该表单。
在 <el-form> 标签上添加 @submit.native.prevent
<el-form
ref="formRef"
:model="formData"
label-position="left"
label-width="120px"
@submit.native.prevent
>