V
vue-options-api-best-practices
by @vuejs-aiv
4.4(112)
遵循Vue 3 Options API最佳实践,管理组件数据、方法和上下文,提升开发效率和代码可维护性。
安装方式
npx skills add vuejs-ai/skills --skill vue-options-api-best-practicescompare_arrows
Before / After 效果对比
1 组使用前
在Vue 3中使用Options API时,可能不清楚如何应用最佳实践、集成TypeScript或避免常见陷阱,导致代码质量参差不齐。
使用后
遵循Vue 3 Options API最佳实践,结合TypeScript进行类型推断,编写更健壮、可维护和易于理解的Vue组件。
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
用户评价 (0)
发表评价
效果
易用性
文档
兼容性
暂无评价
统计数据
安装量5.3K
评分4.4 / 5.0
版本
更新日期2026年5月21日
对比案例1 组
用户评分
4.4(112)
5
23%
4
51%
3
23%
2
3%
1
0%
为此 Skill 评分
0.0
兼容平台
🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI
时间线
创建2026年3月16日
最后更新2026年5月21日