Close
Upgrade to Vue 3 | Vue 2 EOL

API

Global Config

Vue.config is an object containing Vue’s global configurations. You can modify its properties listed below before bootstrapping your application:

silent

optionMergeStrategies

devtools

errorHandler

warnHandler

New in 2.4.0+

ignoredElements

keyCodes

performance

New in 2.2.0+

productionTip

New in 2.2.0+

Global API

Vue.extend( options )

Vue.nextTick( [callback, context] )

Vue.set( target, propertyName/index, value )

Vue.delete( target, propertyName/index )

Vue.directive( id, [definition] )

Vue.filter( id, [definition] )

Vue.component( id, [definition] )

Vue.use( plugin )

Vue.mixin( mixin )

Vue.compile( template )

Vue.observable( object )

New in 2.6.0+

Vue.version

Options / Data

data

props

propsData

computed

methods

watch

Options / DOM

el

template

render

renderError

New in 2.2.0+

Options / Lifecycle Hooks

All lifecycle hooks automatically have their this context bound to the instance, so that you can access data, computed properties, and methods. This means you should not use an arrow function to define a lifecycle method (e.g. created: () => this.fetchTodos()). The reason is arrow functions bind the parent context, so this will not be the Vue instance as you expect and this.fetchTodos will be undefined.

beforeCreate

created

beforeMount

mounted

beforeUpdate

updated

activated

deactivated

beforeDestroy

destroyed

errorCaptured

New in 2.5.0+

Options / Assets

directives

filters

components

Options / Composition

parent

mixins

extends

provide / inject

New in 2.2.0+

Options / Misc

name

delimiters

functional

model

New in 2.2.0

inheritAttrs

New in 2.4.0+

comments

New in 2.4.0+

Instance Properties

vm.$data

vm.$props

New in 2.2.0+

vm.$el

vm.$options

vm.$parent

vm.$root

vm.$children

vm.$slots

vm.$scopedSlots

New in 2.1.0+

vm.$refs

vm.$isServer

vm.$attrs

New in 2.4.0+

vm.$listeners

New in 2.4.0+

Instance Methods / Data

vm.$watch( expOrFn, callback, [options] )

Note: when mutating (rather than replacing) an Object or an Array, the old value will be the same as new value because they reference the same Object/Array. Vue doesn’t keep a copy of the pre-mutate value.

vm.$set( target, propertyName/index, value )

vm.$delete( target, propertyName/index )

Instance Methods / Events

vm.$on( event, callback )

vm.$once( event, callback )

vm.$off( [event, callback] )

vm.$emit( eventName, […args] )

Instance Methods / Lifecycle

vm.$mount( [elementOrSelector] )

vm.$forceUpdate()

vm.$nextTick( [callback] )

vm.$destroy()

Directives

v-text

v-html

v-show

v-if

v-else

v-else-if

New in 2.1.0+

v-for

v-on

v-bind

v-model

v-slot

v-pre

v-cloak

v-once

Special Attributes

key

ref

is

slot deprecated

Prefer v-slot in 2.6.0+.

slot-scope deprecated

Prefer v-slot in 2.6.0+.

scope removed

Replaced by slot-scope in 2.5.0+. Prefer v-slot in 2.6.0+.

Used to denote a <template> element as a scoped slot.

Built-In Components

component

transition

transition-group

keep-alive

slot

VNode Interface

Server-Side Rendering