vue-options-api-best-practices
Vue 3 Options API style (data(), methods, this context). Each reference shows Options API solution only.
- License 许可
- MIT
- 最近更新
- 2026-04-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- vue-options-api-best-practices
- author
- github.com/vuejs-ai
- license
- MIT
- version
- 2.0.0
- description
- Vue 3 Options API style (data(), methods, this context). Each reference shows Options API solution only.
02 资源文件 11
- 参考文档reference/no-arrow-functions-in-lifecycle-hooks.md2.8 KB
- 参考文档reference/no-arrow-functions-in-methods.md2.0 KB
- 参考文档reference/stateful-methods-lifecycle.md1.9 KB
- 参考文档reference/ts-options-api-arrow-functions-validators.md4.6 KB
- 参考文档reference/ts-options-api-computed-return-types.md4.8 KB
- 参考文档reference/ts-options-api-proptype-complex-types.md4.8 KB
- 参考文档reference/ts-options-api-provide-inject-limitations.md3.3 KB
- 参考文档reference/ts-options-api-type-event-handlers.md5.5 KB
- 参考文档reference/ts-options-api-use-definecomponent.md4.6 KB
- 参考文档reference/ts-strict-mode-options-api.md4.7 KB
- 参考文档skill-report.json12.7 KB
03 SKILL.md 正文
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
- Enabling type safety for Options API this context → See ts-strict-mode-options-api
- Using old TypeScript versions with prop validators → See ts-options-api-arrow-functions-validators
- Event handler parameters need proper type safety → See ts-options-api-type-event-handlers
- Need to type object or array props with interfaces → See ts-options-api-proptype-complex-types
- Injected properties missing TypeScript types completely → See ts-options-api-provide-inject-limitations
- Complex computed properties lack clear type documentation → See ts-options-api-computed-return-types
Methods & Lifecycle
- Methods aren't binding to component instance context → See no-arrow-functions-in-methods
- Lifecycle hooks losing access to component data → See no-arrow-functions-in-lifecycle-hooks
- Debounced functions sharing state across component instances → See stateful-methods-lifecycle
04 同仓库更多 Skills
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
vue-testing-best-practices
Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.
vue-router-best-practices
Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.
vue-pinia-best-practices
Pinia stores, state management patterns, store setup, and reactivity with stores.
vue-development-guides
A collection of best practices and tips for developing applications using Vue.js. This skill MUST be apply when developing, refactoring or reviewing Vue.js or Nuxt projects.
vue-best-practices
MUST be used for Vue.js tasks. Strongly recommends Composition API with `<script setup>` and TypeScript as the standard approach. Covers Vue 3, SSR, Volar, vue-tsc. Load for any Vue, .vue files, Vue Router, Pinia, or Vite with Vue work. ALWAYS use Composition API unless the project explicitly requires Options API.