The 'KeyboardEvent.keyCode' modifier 'v-on' directive is deprecated. Use "KeyboardEvent.key" instead of view
P粉348088995
P粉348088995 2024-03-19 17:57:43
0
1
362

I am migrating my application vue 2 to vue 3. I'm getting some deprecation errors when running the application.

In my keyboard event modifier, I use numbers and keys for keyboard events. However, this concept is deprecated, so I'm getting errors. I don't know how to use it now?

Previously

@keyup.ctrl.86="onUpdateEvent()"

I'm getting an error due to the use of numbers. How to solve these problems?

P粉348088995
P粉348088995

reply all(1)
P粉662089521

You can find this in the documentation: https://v3-migration.vuejs.org/writing-changes/keycode-modifiers.html#_3-x-syntax

It looks like you should use the dash naming for the key rather than the numeric keycode, so in this case you would use @keyup.ctrl.v.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template