vue-options-api-best-practices
vuejs-ai/skills
Vue 3のOptions APIに関するベストプラクティス、TypeScriptとの連携のヒント、およびよくある落とし穴への対処法を紹介します。
...すべて拡張しますVue.jsのOptions APIに関するベストプラクティス、TypeScriptとの連携、およびよくある落とし穴。
TypeScript
- コンポーネントのプロパティに対して TypeScript の型推論を有効にする必要がある → ts-options-api-use-define-component を参照
- Options API のこのコンテキストで型安全性を有効にする → ts-strict-mode-options-api を参照
- プロパティバリデータで古いバージョンの TypeScript を使用する場合 → ts-options-api-arrow-functions-validators を参照
- イベントハンドラのパラメータには適切な型安全性が求められる → 「ts-options-api-type-event-handlers」を参照
- インターフェースを使用してオブジェクトまたは配列のプロパティに型を指定する必要がある → ts-options-api-proptype-complex-types を参照
- 注入されたプロパティに TypeScript の型が完全に欠落している → ts-options-api-provide-inject-limitations を参照
- 複雑な計算プロパティに明確な型ドキュメントがない → ts-options-api-computed-return-types を参照
メソッドとライフサイクル
- メソッドがコンポーネントインスタンスのコンテキストにバインドされていない → no-arrow-functions-in-methods を参照
- ライフサイクルフックがコンポーネントデータにアクセスできなくなる → no-arrow-functions-in-lifecycle-hooksを参照
- デバウンスされた関数がコンポーネントインスタンス間で状態を共有している → stateful-methods-lifecycle を参照
---
name: vue-options-api-best-practices
description: Provides Vue 3 Options API best practices, TypeScript integration tips, and solutions to common gotchas.
license: MIT
---
Vue.js Options API best practices, TypeScript integration, and common gotchas.
### TypeScript
- Need to enable TypeScript type inference for component properties → See [ts-options-api-use-definecomponent](reference/ts-options-api-use-definecomponent.md)
- Enabling type safety for Options API this context → See [ts-strict-mode-options-api](reference/ts-strict-mode-options-api.md)
- Using old TypeScript versions with prop validators → See [ts-options-api-arrow-functions-validators](reference/ts-options-api-arrow-functions-validators.md)
- Event handler parameters need proper type safety → See [ts-options-api-type-event-handlers](reference/ts-options-api-type-event-handlers.md)
- Need to type object or array props with interfaces → See [ts-options-api-proptype-complex-types](reference/ts-options-api-proptype-complex-types.md)
- Injected properties missing TypeScript types completely → See [ts-options-api-provide-inject-limitations](reference/ts-options-api-provide-inject-limitations.md)
- Complex computed properties lack clear type documentation → See [ts-options-api-computed-return-types](reference/ts-options-api-computed-return-types.md)
### Methods & Lifecycle
- Methods aren't binding to component instance context → See [no-arrow-functions-in-methods](reference/no-arrow-functions-in-methods.md)
- Lifecycle hooks losing access to component data → See [no-arrow-functions-in-lifecycle-hooks](reference/no-arrow-functions-in-lifecycle-hooks.md)
- Debounced functions sharing state across component instances → See [stateful-methods-lifecycle](reference/stateful-methods-lifecycle.md)
すべてのファイル
11件のファイルvue-options-api-best-practicesをインストール
スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。
ZIPをダウンロードリポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。
git clone https://github.com/vuejs-ai/skills/tree/main/skills/vue-options-api-best-practices # Copy SKILL.md to your .claude/skills/ directory
コピー





家
