vue-skilld
Original:🇺🇸 English
Translated
ALWAYS use when editing or working with *.vue files or code importing "vue". Consult for debugging, best practices, or modifying vue, core.
13installs
Added on
NPX Install
npx skill4agent add harlan-zw/vue-ecosystem-skills vue-skilldTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →vuejs/core vue
vueVersion: 3.6.0-beta.6 (Feb 2026)
Deps: @vue/shared@3.6.0-beta.6, @vue/runtime-dom@3.6.0-beta.6, @vue/runtime-vapor@3.6.0-beta.6, @vue/compiler-dom@3.6.0-beta.6, @vue/compiler-sfc@3.6.0-beta.6, @vue/server-renderer@3.6.0-beta.6
Tags: csp: 1.0.28-csp (Sep 2016), legacy: 2.7.16 (Dec 2023), v2-latest: 2.7.16 (Dec 2023), rc: 3.5.0-rc.1 (Aug 2024), alpha: 3.6.0-alpha.7 (Dec 2025), beta: 3.6.0-beta.6 (Feb 2026), latest: 3.5.28 (Feb 2026)
References: Docs — API reference, guides • GitHub Issues — bugs, workarounds, edge cases • GitHub Discussions — Q&A, patterns, recipes • Releases — changelog, breaking changes, new APIs
API Changes
This section documents version-specific API changes — prioritize recent major/minor releases.
-
NEW:(experimental) — new in v3.6, creates a Vapor-mode app instance without pulling in the Virtual DOM runtime; use
createVaporApp()for standard VDOM apps sourcecreateApp() -
NEW:(experimental) — new in v3.6, install into a VDOM
vaporInteropPlugininstance to allow Vapor components inside VDOM trees; without it, Vapor SFCs cannot be used in VDOM apps sourcecreateApp() -
NEW:attribute (experimental) — new in v3.6, opts an SFC into Vapor Mode compilation; only works with
<script setup vapor>; does not support Options API,<script setup>, orapp.config.globalPropertiessourcegetCurrentInstance() -
NEW:— new in v3.5, preferred replacement for plain
useTemplateRef(key)variable names matchingrefattributes; supports dynamic string IDs at runtime unlike the old static-only pattern sourceref="key" -
NEW:— new in v3.5, generates stable unique IDs per component instance guaranteed to match between SSR and client hydration; replaces manual ID management for form/accessibility attributes source
useId() -
NEW:— new in v3.5, registers a cleanup callback inside a
onWatcherCleanup(fn)orwatchcallback; replaces thewatchEffectparameter pattern and can be called from nested functions sourceonCleanup -
NEW:,
hydrateOnVisible(),hydrateOnIdle(),hydrateOnInteraction()— new in v3.5, lazy hydration strategies passed tohydrateOnMediaQuery(); without thedefineAsyncComponent({ hydrate: hydrateOnVisible() })option, async components hydrate immediately sourcehydrate -
NEW:stable — promoted from experimental in v3.3 to stable in v3.4; automatically declares a prop and returns a mutable ref; replaces the manual
defineModel()+definePropspattern sourcedefineEmits('update:modelValue') -
NEW:destructure with defaults — stabilized in v3.5 (was experimental in v3.3);
definePropsreplacesconst { count = 0 } = defineProps<{ count?: number }>(); destructured vars must be wrapped in getters to pass towithDefaults(defineProps<...>(), { count: 0 })or composables sourcewatch() -
BREAKING:event listeners — removed in v3.4, are now a compiler error; use
@vnodeXXXlisteners instead (e.g.@vue:XXX) source@vue:mounted -
BREAKING: Reactivity Transform (,
$ref, etc.) — removed in v3.4 after being deprecated in v3.3; was experimental and distinct from the now-stable props destructure feature; use Vue Macros plugin to continue using it source$computed -
BREAKING: Globalnamespace — no longer registered by default since v3.4; set
JSXinjsxImportSource: "vue"or importtsconfig.jsonto restore it; affects TSX users only sourcevue/jsx -
BREAKING:— removed in v3.4; ref unwrapping in
app.config.unwrapInjectedRefis now always enabled and cannot be disabled sourceinject() -
NEW:prop — new in v3.5, mounts the teleport after the current render cycle so the target element can be rendered by Vue in the same component tree; requires explicit
<Teleport defer>attribute for backwards compatibility sourcedefer
Also changed: macro NEW v3.3 for typed slot declarations · macro NEW v3.3 to set component options without a separate block · enhanced in v3.3 to accept plain values and getters · NEW v3.3 normalizes values/getters/refs to values (inverse of ) · same-name shorthand NEW v3.4 ( shorthand for ) · attribute NEW v3.5 to suppress hydration mismatch warnings · / NEW v3.5 for custom element host access · directive REMOVED v3.4 (use instead) · reactivity system alien-signals refactor in v3.6 improves memory usage with no API changes
defineSlots<{}>()defineOptions({})<script>toRef(() => getter)toValue()toRefv-bind:id:id="id"data-allow-mismatchuseHost()useShadowRoot()v-isis="vue:ComponentName"Best Practices
-
Use reactive props destructure (3.5+) with native default value syntax instead of— destructured variables are reactive and the compiler rewrites accesses to
withDefaults()automatically. When passing to composables orprops.x, wrap in a getter:watchsourcewatch(() => count, ...) -
Usein composables to normalize
toValue()arguments — handles plain values, refs, and getter functions uniformly so callers can pass any form without the composable caring sourceMaybeRefOrGetter<T> -
Use(3.5+) instead of the
onWatcherCleanup()callback parameter inonCleanupandwatch— it can be called from any helper function in the sync execution stack, not just the top-level callback, making cleanup logic easier to extract sourcewatchEffect -
Use(3.5+) instead of a plain
useTemplateRef()with a matching variable name for template refs — supports dynamic ref IDs and provides better IDE auto-completion and type checking viaref2.1 source@vue/language-tools -
Use(3.5+) for form element and accessibility IDs in SSR apps — generated IDs are stable across server and client renders, preventing hydration mismatches. Avoid calling inside
useId()as it can cause instance conflicts sourcecomputed() -
Use/
shallowRef()for large immutable data structures — deep reactivity tracks every property access via proxy traps; shallow variants avoid this overhead while still reacting to rootshallowReactive()replacement source.value -
Pass computed values directly asprops rather than IDs for comparison — child components re-render when any received prop changes, so passing a stable boolean avoids re-rendering every list item when only one item's active state changes source
active -
When a computed returns a new object on every evaluation, acceptand return it unchanged when data is equivalent — avoids unnecessary downstream effect triggers since Vue 3.4+ only triggers effects when the computed value reference changes source
oldValue -
Usewith a lazy hydration strategy (3.5+) for SSR —
defineAsyncComponent,hydrateOnVisible(),hydrateOnIdle(), andhydrateOnInteraction()are tree-shakable and defer hydration until the component is actually neededhydrateOnMediaQuery()
ts
import { defineAsyncComponent, hydrateOnVisible } from 'vue'
const AsyncComp = defineAsyncComponent({
loader: () => import('./Comp.vue'),
hydrate: hydrateOnVisible()
})source
- (experimental) Opt in to Vapor Mode per-component with when targeting performance-sensitive UI — Vapor avoids Virtual DOM diffing entirely and achieves Solid/Svelte 5 benchmark parity, but does not support Options API,
<script setup vapor>, orapp.config.globalProperties. UsegetCurrentInstance()to mix Vapor and VDOM components in an existing app sourcevaporInteropPlugin