
Vue
SkillReference for Vue 3.5: script setup and macros such as defineProps, defineEmits and defineModel, reactivity, watchers and lifecycle, and built-ins like Transition, Teleport, Suspense and KeepAlive. Prefers the Composition API with TypeScript. Generated by Anthony Fu from the official docs.
name: vue
description: Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.
metadata:
author: Anthony Fu
version: "2026.9.25"
source: Generated from https://github.com/vuejs/docs, scripts at https://github.com/antfu/skills
Vue
Based on Vue 3.5, generated at 2026-09-25. Always use Composition API with
<script setup lang="ts">.
Preferences
- Prefer TypeScript over JavaScript
- Prefer
<script setup lang="ts">over<script> - For performance, prefer
shallowRefoverrefif deep reactivity is not needed - Always use Composition API over Options API
- Discourage using Reactive Props Destructure
Core
| Topic | Description | Reference |
|---|---|---|
| Script Setup & Macros | <script setup>, defineProps, defineEmits, defineModel, defineExpose, defineOptions, defineSlots, generics | script-setup-macros |
| Reactivity & Lifecycle | ref, shallowRef, computed, watch, watchEffect, effectScope, lifecycle hooks, composables | core-new-apis |
Features
| Topic | Description | Reference |
|---|---|---|
| Built-in Components & Directives | Transition, Teleport, Suspense, KeepAlive, v-memo, custom directives | advanced-patterns |
Quick Reference
Component Template
<script setup lang="ts">
import { ref, computed, watch, onMounted } from 'vue'
const props = defineProps<{
title: string
count?: number
}>()
const emit = defineEmits<{
update: [value: string]
}>()
const model = defineModel<string>()
const doubled = computed(() => (props.count ?? 0) * 2)
watch(() => props.title, (newVal) => {
console.log('Title changed:', newVal)
})
onMounted(() => {
console.log('Component mounted')
})
</script>
<template>
<div>{{ title }} - {{ doubled }}</div>
</template>
Key Imports
// Reactivity
import { ref, shallowRef, computed, reactive, readonly, toRef, toRefs, toValue } from 'vue'
// Watchers
import { watch, watchEffect, watchPostEffect, onWatcherCleanup } from 'vue'
// Lifecycle
import { onMounted, onUpdated, onUnmounted, onBeforeMount, onBeforeUpdate, onBeforeUnmount } from 'vue'
// Utilities
import { nextTick, defineComponent, defineAsyncComponent } from 'vue'
関連リソース

Nuxt
SkillReference for Nuxt 5, the full-stack Vue framework: directory layout, file-based routing, useFetch, auto-imports, server routes, rendering modes, SSR and hydration pitfalls, modules and layers, with notes on the move to Nitro v3 and Vite 8. Generated by Anthony Fu from the official docs.
antfu/skills6k
Pinia
SkillReference for Pinia v4, Vue's official state library: defining stores with state, getters and actions, plugins, composables, composing stores, testing with @pinia/testing, SSR, Nuxt and HMR. Recommends setup stores and storeToRefs. Generated by Anthony Fu from the official docs.
antfu/skills6k
Create Adaptable Composable
SkillGuides the agent in writing library-grade Vue composables whose inputs accept a plain value, ref or getter: choose MaybeRefOrGetter or MaybeRef depending on whether the input is read-only or writable, and normalize with toValue() and toRef() inside watchers. Requires Vue 3 or Nuxt 3+.
vuejs-ai/skills2.9k
Vue Best Practices
SkillDefault workflow for Vue work: standardizes on Vue 3, the Composition API and script setup with TypeScript, reads core references on reactivity, SFCs, data flow and composables, plans component boundaries first, loads topics like slots, transitions and performance only when needed, then self-checks.
vuejs-ai/skills2.9k
Vue Options API Best Practices
SkillFor Vue 3 projects on the Options API (data(), methods, this): how to get TypeScript inference with defineComponent and type props, event handlers and computed values, plus gotchas like avoiding arrow functions in methods and lifecycle hooks and not sharing debounced state across instances.
vuejs-ai/skills2.9k
Vite
SkillReference for Vite 8: vite.config.ts, features like import.meta.glob and asset queries, the plugin API, library mode and SSR, the Environment API, and migrating to the Rolldown bundler and Oxc transformer. Prefers TypeScript config and ESM. Generated by Anthony Fu from the official docs.
antfu/skills6k