Frontend/Vue 2
vue3 @keydown
SOLYI
2021. 10. 18. 23:25
<template>
<input type="text"
@keydown.ctrl.shift.a="handler" >
</template>
<script>
export default {
methods:{
handler(){
console.log("!!! key !!!")
}
}
}
</script>
@keydown.a = a키 누르면 반응
@keydown.ctrl.a = 컨트롤+a키 누르면 반응
@keydown.enter = 엔터키 누르면 반응
반응형