- Start Date: 2019-11-08
- Target Major Version: 3.x
- Reference Issues: N/A
- Implementation PR: N/A
- Drop support for using numbers (keyCodes) as
v-onmodifiers - Remove
config.keyCodes
N/A
In Vue 2.x, v-on already supports using the kebab-case version of any valid KeyboardEvent.key as a modifier. For example, to trigger the handler only when event.key === 'PageDown':
<input @keyup.page-down="onArrowUp">This makes number keyCodes and config.keyCodes redundant. In addition, KeyboardEvent.keyCode has been deprecated, so it would make sense for Vue to stop supporting it as well.
N/A
N/A
-
A codemod can detect usage of number
keyCodemodifier usage and convert it tokeyequivalents. -
In compat build,
config.keyCodecan be supported, and the runtime can emit warning when a keyCode alias is matched to allow easy migration.