App.vue
<script setup>
</script>
<template>
<div class="container" @keydown="console.log('pressed')">
<h1>Hello</h1>
</div>
</template>
<style scoped>
.container {
width: 100vw;
height: 100vh;
}
</style>
I want on keydown to log (‘pressed’) to the console
The project has been created with npm create vue@latest
. Everything standard and nothing changed other than App.vue. No Vue Router involved
No matter what I do the event wont fire. if I change the event to @clicked it works perfectly fine.