vue中提供了一些按键修饰符,开发者可以直接通过按键修饰符捕捉键盘事件
<input v-on:keyup.enter="submit">
但是在开发过程中会遇到不生效的情况,解决办法就是加上 .native 修饰
<input v-on:keyup.enter.native="submit">