wip: make tests pass again

This commit is contained in:
Evan You
2021-04-08 16:33:53 -04:00
parent 18cf63ff05
commit f8e2361d83
4 changed files with 17 additions and 4 deletions

View File

@@ -60,8 +60,11 @@ export const withKeys = (fn: Function, modifiers: string[]) => {
let globalKeyCodes: LegacyConfig['keyCodes']
if (__COMPAT__) {
if (compatUtils.isCompatEnabled(DeprecationTypes.CONFIG_KEY_CODES)) {
globalKeyCodes = ((getCurrentInstance()!.appContext
.config as any) as LegacyConfig).keyCodes
const instance = getCurrentInstance()
if (instance) {
globalKeyCodes = ((instance.appContext.config as any) as LegacyConfig)
.keyCodes
}
}
if (__DEV__ && modifiers.some(m => /^\d+$/.test(m))) {
compatUtils.warnDeprecation(DeprecationTypes.V_ON_KEYCODE_MODIFIER)