I have a confirm Button, that should also be triggered by an Enter-Event.
Basically, I was hoping that this could work:
<someComponent @keyup.enter="handleConfirm" />
...
methods: {
handleConfirm(event) {
console.log("works")
}
}
But it doesn't. Apparently, this approach only works with input fields.
How can I listen to a keyup Event in Vue on any element/component?
EDIT To clarify: Any element/component even out of focus.