<input v-on:keyup.13="addToCount" v-model="addValue">
In the above example, when the keyup event is fired with the key code of 13 (the enter key), the addToCount
method gets called.
Since it’s difficult to remember all of the key codes, Vue provides a set of pre-defined keys. Some examples are enter, tab, delete, esc, space and left.
Also, it’s possible to setup your own alias for key codes as follows: