Vue Reference

Last updated: 2026-10-22

Vue Reference

Alphabetical list of 121 Vue API entries: directives, Composition API, Options API, built-ins and global API.

#
$attrs$attrs gathers attributes the parent passed that props did not declare — forward them prec...
$emit()$emit fires a custom event whose arguments arrive in the parent's listener — the standard ...
$refs$refs holds the elements or component instances marked with ref attributes, giving script ...
<component><component :is="..."> renders whichever component or native element the data names — the p...
<KeepAlive><KeepAlive> caches wrapped component instances so state survives switching and re-renderin...
<slot><slot> marks where parent-provided content lands inside a child template, optionally with ...
<Suspense><Suspense> shows fallback content while async dependencies (async components or async setu...
<Teleport><Teleport> renders its content elsewhere in the DOM (such as body), escaping overflow clip...
<template><template> is a transparent grouping wrapper — it renders nothing itself, useful for v-if/...
<Transition><Transition> wraps a single element or component and applies transition classes or hooks w...
<TransitionGroup><TransitionGroup> animates lists of elements, including smooth positional moves via FLIP.
A
activatedactivated runs when a component cached by <KeepAlive> is shown again — resume polling or r...
app.component()app.component() registers a component globally, available to every template — for base com...
app.configapp.config carries app-wide settings such as errorHandler, warnHandler, globalProperties a...
app.directive()app.directive() registers a global custom directive usable as v-xxx anywhere — for permiss...
app.mount()app.mount() attaches the app to a container element, replacing its inner DOM with the app'...
app.provide()app.provide() supplies a dependency app-wide so every component can inject it — for config...
app.use()app.use() installs a plugin that may register globals, inject dependencies or extend confi...
B
beforeCreatebeforeCreate runs before the instance is initialised — data, methods and computed do not e...
beforeMountbeforeMount runs right before the initial render — the render function is ready but no DOM...
beforeUnmountbeforeUnmount runs just before the instance is destroyed — the DOM is still intact, the mo...
beforeUpdatebeforeUpdate runs after data changes but before the DOM patch — it still reads the previou...
C
componentsThe components option registers child components locally, keeping them scoped to this comp...
computedThe computed option declares derived values that recalculate and cache when dependencies c...
computed()computed() derives a value from other reactive state and caches it: it re-evaluates only w...
createApp()createApp() creates an app instance from the root component; the returned object registers...
createdcreated runs once the instance is initialised with data and methods available but no DOM —...
createSSRApp()createSSRApp() matches createApp but hydrates server-rendered HTML instead of re-rendering...
customRef()customRef() lets you control dependency tracking and triggering via a factory — the classi...
D
dataThe data option declares reactive component state as a function returning an object, so ev...
deactivateddeactivated runs when a cached component is hidden — it is not destroyed, so pause timers ...
defineAsyncComponent()defineAsyncComponent() creates a component loaded on demand at first render — for route-le...
defineComponent()defineComponent() is a typing helper — mainly for precise TypeScript inference; at runtime...
defineCustomElement()defineCustomElement() wraps a Vue component as a standards-based custom element usable in ...
E
effectScope()effectScope() groups watchers and computed into one scope that starts and stops as a unit ...
emitsThe emits option documents and validates events a component fires; undeclared emissions wa...
errorCapturederrorCaptured catches errors from descendant components; returning false stops propagation...
exposeThe expose option restricts which members a parent reaches through a template ref; everyth...
G
getCurrentScope()getCurrentScope() returns the active effectScope or undefined — useful to attach effects t...
H
h()h() creates virtual nodes (VNodes) — the primitive under render functions and JSX.
hasInjectionContext()hasInjectionContext() reports whether inject() can be called here — a guard for shared uti...
I
inheritAttrsinheritAttrs: false stops undeclared attributes from landing on the root element, letting ...
injectThe inject option declares dependencies — an array without defaults, or an object with fro...
inject()inject() reads data provided by an ancestor, optionally falling back to a default.
isThe is attribute tells <component> which component or native tag to render, including nati...
isProxy()isProxy() reports whether a value is a proxy created by reactive() or readonly().
isReactive()isReactive() reports whether a value was created by reactive() or a proxy derived from one...
isReadonly()isReadonly() reports whether a value is a readonly proxy created by readonly().
isRef()isRef() tells whether a value is a ref object — handy in utilities that must handle both p...
K
keykey identifies list items for v-for, letting Vue reuse or rebuild nodes correctly when lis...
M
markRaw()markRaw() marks an object so it is never proxied even inside reactive structures — for thi...
mergeProps()mergeProps() merges prop objects — class and style concatenate, listeners all survive, lat...
methodsThe methods option collects component functions used as event handlers and helpers, called...
mountedmounted runs after the component is rendered into the DOM — the standard place for templat...
N
nameThe name option labels a component, affecting Devtools, recursive self-reference and error...
nextTick()nextTick() returns a Promise resolving after the next DOM flush — use it to read fresh DOM...
O
onActivated()onActivated() runs when a component cached by <KeepAlive> is shown again — resume timers o...
onBeforeMount()onBeforeMount() runs just before the component's first render — the template is compiled b...
onBeforeUnmount()onBeforeUnmount() runs just before the component is destroyed — the DOM is still intact, t...
onBeforeUpdate()onBeforeUpdate() runs after reactive data changes but before the DOM updates — read the pr...
onDeactivated()onDeactivated() runs when a cached component is hidden — it is not destroyed, so pause tim...
onErrorCaptured()onErrorCaptured() catches errors thrown by descendant components during render, lifecycle ...
onMounted()onMounted() runs after the component and its children are in the DOM — the standard spot f...
onRenderTracked()onRenderTracked() fires for every reactive dependency collected during render — a devtool ...
onRenderTriggered()onRenderTriggered() fires when a dependency change schedules a re-render, telling you exac...
onScopeDispose()onScopeDispose() runs a cleanup when the current scope stops — composables use it to unreg...
onServerPrefetch()onServerPrefetch() runs during server-side rendering only, letting async data resolve befo...
onUnmounted()onUnmounted() runs after the component is destroyed, its DOM removed and all its reactive ...
onUpdated()onUpdated() runs after the component re-renders and the DOM is patched — read fresh measur...
onWatcherCleanup()onWatcherCleanup() registers a teardown that runs before the watcher re-runs or stops — fo...
P
propsprops declares the attributes a component accepts, with array shorthand or object syntax f...
provideThe provide option supplies data downwards — an object for static values, a function for v...
provide()provide() exposes data from an ancestor so any descendant can inject() it — no prop drilli...
R
reactive()reactive() wraps an object or array in a deep reactive proxy — reading and writing propert...
readonly()readonly() creates a readonly proxy of the source: writes warn and fail, protecting data f...
refThe ref attribute names an element or component for script access via $refs or ref()/useTe...
ref()ref() wraps any value in a reactive object accessed through .value. It is the way to hold ...
renderThe render option returns virtual nodes instead of template markup — for fully programmati...
renderToString()renderToString() renders an app to an HTML string on the server — the SSR output step, hyd...
resolveComponent()resolveComponent() looks up a registered component by name inside render functions, ready ...
S
shallowReactive()shallowReactive() makes only the first level of properties reactive; nested objects stay u...
shallowReadonly()shallowReadonly() makes only the first level readonly; nested objects remain writable.
shallowRef()shallowRef() only tracks replacement of .value — swapping the whole value updates, mutatin...
slotsThe slots option declares slot access as a function, producing a tracked $slots — slot pre...
T
templateThe template option supplies a component's HTML as a string, compiled at runtime in the fu...
toRaw()toRaw() returns the underlying object behind a proxy — for bypassing reactivity or handing...
toRef()toRef() converts one property of a reactive object into a ref that stays linked — reading ...
toRefs()toRefs() turns each property of a reactive object into a ref so destructured values stay r...
toValue()toValue() resolves a plain value, ref or getter into the current value — reusable function...
triggerRef()triggerRef() manually triggers effects linked to a shallow ref — the escape hatch when inn...
U
unmountedunmounted runs after the instance is destroyed and its DOM removed — the final place for r...
unref()unref() is shorthand for isRef(v) ? v.value : v — refs yield their inner value, plain valu...
updatedupdated runs after a data change re-renders the component and the DOM is patched — for re-...
useAttrs()useAttrs() returns fallthrough attributes not declared as props or emits — for manual forw...
useHost()useHost() returns the host element inside a custom element, letting you touch its attribut...
useId()useId() returns a per-instance stable unique ID for accessibility attributes like label/fo...
useModel()useModel() defines a writable model inside <script setup> so a parent's v-model binds to i...
useSlots()useSlots() exposes the slot functions passed by the parent — handy to test presence or ren...
useSSRContext()useSSRContext() retrieves the SSR context during server rendering so data can be carried i...
useTemplateRef()useTemplateRef() reads a template ref by its string name, removing the need to declare a m...
V
v-bind (:)v-bind binds an expression to an HTML attribute, shorthand colon. class and style addition...
v-cloakv-cloak stays on the element until compilation finishes; paired with CSS it hides the raw ...
v-elsev-else provides the 'otherwise' branch for v-if: it renders when v-if is falsy and takes n...
v-else-ifv-else-if chains multiple conditional branches, evaluating each until one is truthy.
v-forv-for renders a list of elements by iterating an array or object with the syntax item in i...
v-htmlv-html parses a string as HTML and injects it into the element — used for rich text conten...
v-ifv-if renders a block only when the expression is truthy. When falsy the element is destroy...
v-memov-memo takes a dependency array; when unchanged the whole subtree is skipped — a performan...
v-modelv-model creates two-way binding between a form control and data: typing updates the state ...
v-on (@)v-on attaches an event listener, shorthand @. Modifiers like .stop, .prevent or .once cust...
v-oncev-once renders the element only once; later changes to its data do not re-render it — a mi...
v-prev-pre skips compilation for this element and its children, showing template syntax like {{...
v-showv-show toggles the element's display style from the expression. The element always stays i...
v-slot (#)v-slot declares slot content, shorthand #. It passes template fragments into a child compo...
v-textv-text sets the element's textContent from the expression. It equals mustache interpolatio...
W
watchThe watch option keys callbacks by the watched property name, supporting handler, deep, im...
watch()watch() observes one or more reactive sources and runs a callback on change with old and n...
watchEffect()watchEffect() runs the function immediately and tracks whatever reactive data it reads — r...
watchPostEffect()watchPostEffect() equals watchEffect with flush: 'post' — it runs after the component's DO...
watchSyncEffect()watchSyncEffect() equals watchEffect with flush: 'sync' — it fires immediately on change w...
withModifiers()withModifiers() applies modifier behaviour such as stop, prevent and once to handlers insi...
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏