Give an example to demonstrate how do you define custom key modifier aliases in Vue.js?

We can define custom key modifier aliases via the global config.keyCodes. Following are some guidelines for the properties:

  • We can’t use camelCase. Instead, we should use a kebab-case with double quotation marks.
  • We can define multiple values in an array format.

See the example:

  1. Vue.config.keyCodes = {  
  2.   f1: 112,  
  3.   “media-play-pause”: 179,  
  4.   down: [40, 87]  
  5. }