web-framework-vue-composition-api
Installation
SKILL.md
Vue 3 Composition API
Quick Guide:
<script setup>for every component.ref()for primitives and anything reassigned,reactive()for an object mutated in place. Reusable stateful logic goes into ause*composable that returns an object of refs. Everything opened inonMountedis closed inonUnmounted. The 3.4+ and 3.5+ macros —defineModel(),useTemplateRef(),useId(),onWatcherCleanup()— replace whole patterns that preceded them, and destructured props need a getter wrapper inwatch().
Detailed Resources:
- examples/core.md — a complete component, template refs, focus management
- examples/reactivity.md —
ref,reactive,computedand their anti-patterns - examples/composables.md — useFetch, useLocalStorage, useDebounce, useIntersectionObserver
- examples/lifecycle.md — WebSockets, timers, event listeners, cleanup
- examples/provide-inject.md — theme provider, typed injection keys
- examples/define-expose.md — form field validation, parent-child coordination
- examples/vue-3-5-features.md — defineModel, useTemplateRef, useId, onWatcherCleanup, reactive destructure, deferred Teleport
- examples/async.md — lazy loading, Suspense, async setup
- reference.md — decision trees, anti-patterns with corrected code, checklists, TypeScript patterns