Closed
Description
If you do e.g. @keydown.space.prevent
(notice the lack of ="someCallback"
), you get this error Type 'undefined' is not assignable to type '((...payload: unknown[]) => void) | ((...args: any) => void)'
. Having an event handler that only has a modifier and no callback is legal and useful, so it shouldn't give an error.
Activity
johnsoncodehk commentedon May 13, 2021
@keydown.space.prevent
do not report error for me, please provide a repro case.henribru commentedon May 13, 2021
Seems like it happens on Vue components but not native HTML elements: https://github.com/henribru/volar-event-handler-repo
fix: native events type incorrect if component no emits option
johnsoncodehk commentedon May 18, 2021
Fixed in 0.25.5. Thanks for your report!