You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Vetur with // @ts-check combined with typescript JSDoc support in JavaScript in my Nuxt project. After playing around with settings in jsconfig.json including adding @nuxt/types, it works great for regular Vue components.
However, when I use asyncData instead of data, Vetur doesn't seem to pick up on the properties that should now be available on this. When I use properties returned by asyncData in computed properties, I get the following error:
Property 'myPropery' does not exist on type 'CombinedVueInstance'
If I add both data and asyncData, then the error goes away:
Based on what I've seen, I'm guessing that the Vetur plugin is tracking the properties that were returned by the data method, but not asyncData. Would it be straightforward to add support for asyncData ?
Reproducible Case
Let me know if I need to provide a repo that reproduces this step.
My jsconfig.json contains the following:
As same reason as #1226, #1355, this should be supported on upstream type declaration and current Vue v2 typings does not support it. We need to wait v3´s composition API.
Info
Problem
I am trying to use Vetur with
// @ts-check
combined with typescript JSDoc support in JavaScript in my Nuxt project. After playing around with settings injsconfig.json
including adding@nuxt/types
, it works great for regular Vue components.However, when I use
asyncData
instead ofdata
, Vetur doesn't seem to pick up on the properties that should now be available onthis
. When I use properties returned byasyncData
in computed properties, I get the following error:Property 'myPropery' does not exist on type 'CombinedVueInstance'
If I add both
data
andasyncData
, then the error goes away:Based on what I've seen, I'm guessing that the Vetur plugin is tracking the properties that were returned by the
data
method, but notasyncData
. Would it be straightforward to add support forasyncData
?Reproducible Case
Let me know if I need to provide a repo that reproduces this step.
My
jsconfig.json
contains the following:The text was updated successfully, but these errors were encountered: