VueJS - How to detect Ctrl+V? VueJS - How to detect Ctrl+V? vue.js vue.js

VueJS - How to detect Ctrl+V?


To detect two keys, Vue provides modifier keys, For example to detect Alt+C, you can simply do:

<input @keyup.alt.67="YourFn">

Similarly for Ctrl+V, you can do:

<input @keyup.ctrl.76="YourFn">

As I can see here, ASCII code for Ctrl+v is 22, so you should be simply able to do :

<input @keyup.22="YourFn">


you can check the js fiddle link for the same

keyup: function(event){    if(event.keyCode == 86 && event.ctrlKey){    // do something here  }}

https://jsfiddle.net/neelkansara28/wh61rby8/16/