Entering a single form form input box and clicking enter will trigger the source code parsing of the default submission event.

problem description



I want to know, what is the cause of the problem? Why can the recommended method be solved?

the environmental background of the problems and what methods you have tried

@ keydown.native.enter.prevent = "keyDownEvent" in the Form tag
Click to trigger the keyDownEvent event in which the key is judged

related codes

/ / Please paste the code text below (do not replace the code with pictures)
in the Form tag

@keydown.native.enter.prevent ="keyDownEvent"

what result do you expect? What is the error message actually seen?

Oct.27,2021

first of all, submit is the default event for native form carriage returns. If you block it with pure js, it should be the method recommended by event.preventDefault, to block this default event through the modifier .effecent (which can be used in Vue). Another modifier, .native, means that only native events are received (events that are internal components of $emit are not triggered).

Menu