What problem does it solve?
Provides concise, opinionated guidance for authoring Vue 3 single-file components with the Composition API so developers avoid common reactivity pitfalls, typing mistakes, and inconsistent component patterns.
Core Features & Use Cases
- Opinionated preferences: favor TypeScript, use <script setup lang="ts">, prefer shallowRef for large structures, and use Composition API over Options API.
- Script setup macros and typing: defineProps, defineEmits, defineModel, defineExpose, defineOptions, and defineSlots with generics and default handling.
- Reactivity and lifecycle patterns: refs, shallowRef, computed, watch/watchEffect with flush timing, effectScope, and lifecycle hooks, plus built-in components like Transition, Teleport, Suspense, and KeepAlive for advanced UI behaviors.
- Use Case: Quickly scaffold strongly-typed components, implement performant list rendering with v-memo, manage async setup with Suspense, or cache view states with KeepAlive while preserving lifecycle hooks.
Quick Start
Create a Vue 3 single-file component using <script setup lang="ts"> that declares typed props title:string and count?:number, emits an update event, computes a doubled value from count, and logs onMounted.