SoFunction
Updated on 2025-04-04

Solve the problem of page refresh caused by vue+element keyboard return event

background

Today I found that after entering the input box, the page will be refreshed after entering it.

solve

 <el-form :inline="true" @>
 </el-form>

el-from plus@

Specifically, it was solved by referring to the element-ui document

The W3C standard has the following provisions:

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.

Right now:When there is only one input box in a form element, press Enter in that input box to submit the form. If you want to block this default behavior, you can add @ on the tag.

The above article solves the problem of page refresh caused by the vue+element keyboard return incident. This is all the content I share with you. I hope you can give you a reference and I hope you can support me more.