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 NUXT with Typescript and really want the class based syntax this module provides but when I looked into the nuxt-class-components modules I saw they were mainly just adding lifecycle hooks via your registerHooks but then I'm not getting any type information from those hooks which is a shame.
I think it would be nice to state in the documentation how one can achieve this.
The text was updated successfully, but these errors were encountered:
@ksnyde You need to augment the type definition for your new lifecycle hooks. Since the TS don't have any previous info about what your building. You need to provide it. This can be done with .d.ts file augmenting the hooks definitions in the module 'vue/types/options' with your own definitions. Try to make a test including a simple string in the definition from your hook and check if you will get the type information from it.
I am trying to use NUXT with Typescript and really want the class based syntax this module provides but when I looked into the
nuxt-class-components
modules I saw they were mainly just adding lifecycle hooks via yourregisterHooks
but then I'm not getting any type information from those hooks which is a shame.I think it would be nice to state in the documentation how one can achieve this.
The text was updated successfully, but these errors were encountered: