el-input Enter to refresh the page

 Reason: When there is only one Input component in the form, press Enter in the input box to submit the form and automatically refresh the page.

Solution:

Use @submit.native.prevent to prevent the default submission behavior of the form, that is, to prevent the default page refresh, but the carriage return event will still be triggered.

 <el-form
   :model="query"
   @submit.native.prevent
 >
</el-form>

Guess you like

Origin blog.csdn.net/m0_49623851/article/details/128115657