AGENT SKILL
Vue 选项式 API 最佳实践
vue-options-api-best-practices
Vue 3 选项式 API 风格(data()、methods、this 上下文)。每个参考示例仅展示选项式 API 方案。
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- 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 资源文件 10
- 参考文档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
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
Kami 专业文档排版
kami
使用 Kami 模板排版专业文档:简历、一页纸、白皮书、信件、作品集和幻灯片。当用户要求做 PDF / 排版 / 简历 / 一页纸 / PPT / slides,或创建 Kami 落地页时使用。不适用于审查或重新设计现有产品网站。
★ 1
hierarchical-agents-md
层级 AGENTS.md / README.md:init、update、audit、reorganize、trim。 初始化 Agent 指令、代码改动后同步文档、检查文档漂移、重组仓库文档层级、精简规则与 Skills。 Not for 写业务代码或生成文档站点。
★ 1
VueUse 组合式函数应用
vueuse-functions
在合适的地方应用 VueUse 组合式函数(composables),以构建简洁、可维护的 Vue.js / Nuxt 功能。
★ 1
Vue.js 测试最佳实践
vue-testing-best-practices
用于 Vue.js 测试。涵盖 Vitest、Vue Test Utils、组件测试、模拟(mocking)、测试模式,以及用于 E2E 测试的 Playwright。
★ 1
Vue Router 路由最佳实践
vue-router-best-practices
Vue Router 4 模式、导航守卫、路由参数以及路由与组件生命周期的交互。
★ 1
Pinia 状态管理最佳实践
vue-pinia-best-practices
Pinia store、状态管理模式、store 配置以及 store 的响应式处理。
★ 1