How to create typescript type for component which must have certain props / events? #14228
Unanswered
shameleo
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here is my attempt to do it
modal-manager.ts
Modal.vue
App.vue
But it has mijor issue: if component has more events, than I defined, typecheck fails. But it shouldn't. Props / events should be required, but extra props / events must be allowed also. Like it usually works in typescript.
PS I added
"strict": trueintsconfig.jsonBeta Was this translation helpful? Give feedback.
All reactions