Nuxt3 component class decorator
npm install nuxt3-class-componentA successor to nuxt-property-decorator for Nuxt 3, based on vue-facing-decorator.
Unlike the original nuxt-property-decorator, this package is implemented as a Nuxt module. This is because it uses defineNuxtComponent internally, which doesn't work outside of Nuxt compilation context.
Install:
``sh`
npm install nuxt3-class-component vue-facing-decorator
Add nuxt3-class-component to the modules section of nuxt.config.ts:
`ts`
export default defineNuxtConfig({
modules: ["nuxt3-class-component"],
})
Your previous Nuxt2 components will work automagically:
`vue
value = {{ value }}
`
It is advised to use the auto-imported NuxtComponent and the underlying vue-facing-decorator instead:
`vue
value = {{ value }}
``
If you find this module useful, please consider a small one-off donation with the ❤️ Sponsor button.