Vue 2 with Volar, Options API, & defineComponent. Vue interface properties throw unavaialble errors, but still exist at runtime. #998
Unanswered
douglasg14b
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using Volar, with Vue 2, TS, and the Options API (Trying to move components over bit by bit). The compiler is showing that
this.$options
orthis.$router
does not exist inside computed's. It shows it does exist inside of methods.Edit:
Another look seems to indicate that this only happens if the variable that is being assigned is returned...?
If I annotate the type, there is no error anymore....?
However, this still exists at runtime, so it's actually available even if the type checking thinks it isn't.
How should this be resolved while using the Options API?
Pmuch none of these show as available in computed:
Beta Was this translation helpful? Give feedback.
All reactions