I am trying to config keyCodes on keyup event Using v-on by Vue.js.
I read the documentation and found Vue.config.keyCodes = {} which is static method user can set custom names to keyCodes.
below is JSFiddle without camelCase and it works well.
Link : without camelCase config
below is JSFiddle with camelCase and it does not work.
Link : with camelCase config
There is example using camelCase in Vue.js documentation.
I think camelCase should work too. why it is not working??
I want to make my input to Alert when I type cmd + enter.
I tried @keyup.91.13, @keyup.91&&13, or keyCode config like
Vue.config.keyCodes = {
hit: 91&&13
}
but it does not work. How can I make this work properly??
Better to use ".meta" because "keyup = 91" don't works for Opera (its "keyup=219" and not 91).
@keyup.meta.enter="yourMethod"
(But I don't know why this don't works for me on Ubuntu)
Note: On Macintosh keyboards, meta is the command key (⌘). On Windows keyboards, meta is the windows key (⊞). On Sun Microsystems keyboards, meta is marked as a solid diamond (◆). On certain keyboards, specifically MIT and Lisp machine keyboards and successors, such as the Knight keyboard, space-cadet keyboard, meta is labeled “META”. On Symbolics keyboards, meta is labeled “META” or “Meta”.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With