vue-options-api-best-practices
SKILL.md
Vue.js 选项式 API 最佳实践、TypeScript 集成和常见陷阱。
TypeScript
- 需要为组件属性启用 TypeScript 类型推断 → 参见 ts-options-api-use-definecomponent
- 为选项式 API this 上下文启用类型安全 → 参见 ts-strict-mode-options-api
- 在旧版 TypeScript 中使用 prop 验证器 → 参见 ts-options-api-arrow-functions-validators
- 事件处理程序参数需要适当的类型安全 → 参见 ts-options-api-type-event-handlers
- 需要使用接口对对象或数组 props 进行类型定义 → 参见 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
Weekly Installs
3
Repository
hello-lizhihua/…ls_zh-cnFirst Seen
12 days ago
Security Audits
Installed on
opencode3
github-copilot3
codex3
kimi-cli3
gemini-cli3
cursor3