`vue-decorator` (v1.1.3, last updated March 2022) aims to provide custom decorators compatible with Vue 3 by acting as a wrapper for `vue-class-component` and `vue-property-decorator`. However, the core dependencies it wraps are largely unmaintained or officially archived for Vue 3 compatibility. `vue-property-decorator` explicitly states it does not support Vue 3, and `vue-class-component` has been superseded by `vue-facing-decorator` for modern Vue 3 class component usage. Due to the unmaintained status of both `vue-decorator` itself and its underlying dependencies for Vue 3, it is not recommended for new projects. Developers should consider `vue-facing-decorator` or directly use Vue 3's Composition API, which is the idiomatic approach for current Vue development. This package has a very slow release cadence, with its last update over two years ago.
npm install vue-decoratorVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic Vue 3 class component using `@Component`, `@Prop`, `@Watch`, and `@Emit` decorators.
Migrate to `vue-facing-decorator` or refactor components to use Vue 3's Composition API with `<script setup>` for better support and maintainability.
Add `"experimentalDecorators": true, "emitDecoratorMetadata": true` to your `compilerOptions` in `tsconfig.json`.
Consider adopting the Composition API for new components and gradually refactoring existing class components. Tools like `vue-class-migrator` can assist in transitions.
It is strongly recommended to use actively maintained alternatives like `vue-facing-decorator`.
Add `"experimentalDecorators": true, "emitDecoratorMetadata": true` to your `compilerOptions` in `tsconfig.json`.
Ensure `vue-class-component` is correctly installed and configured for Vue 3, or, more reliably, migrate to `vue-facing-decorator` or the Composition API.
Use a named import: `import { Component } from 'vue-decorator';`