javascript - How does element ui's el-input monitor the enter key.
阿神2017-05-19 10:46:36
0
5
848
There seems to be no enter event among the officially exposed events, and then writing @keyup.enter directly on el-input failed to catch the event. I hope God can enlighten me~~
@keyup.enter.native
<el-input type="password" v-model="loginForm.password" placeholder="password" @keyup.enter.native="loginSubmit"></el-input>
@keyup.enter.native can be triggered
element-ui api indicates that there is no onkeyup event, so it is recommended to change input if you must use this event
I agree with @CoquettishPoppy’s point of view. I suggest you create a native input with a similar style.