I recently spent far too long fighting with Vue’s keyup and keydown functionality. I wanted to handle ctrl+period keyboard events and it took me forever to find the part of the documentation that addressed my use case.

Take note: This guide is for Vue 3!

If you want to fire an event on ctrl+enter you can just chain the modifier: Event modifiers

If you want to fire your handler when the exact keys you’ve specified are pressed, use the.exact modifier.

Related Articles