vue-options-api-best-practices

Vue.js 选项式 API 最佳实践、TypeScript 集成和常见陷阱。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "vue-options-api-best-practices" with this command: npx skills add hello-lizhihua/skills_zh-cn/hello-lizhihua-skills-zh-cn-vue-options-api-best-practices

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

vue-development-guides

No summary provided by upstream source.

Repository SourceNeeds Review
General

vue-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
General

vue-router-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
General

vue-pinia-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review