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

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, key, value )

Vue.delete( target, key )

Vue.directive( id, [definition] )

Vue.filter( id, [definition] )

Vue.component( id, [definition] )

Vue.use( plugin )

Vue.mixin( mixin )

Vue.compile( template )

Vue.version

var version = Number(Vue.version.split('.')[0])
if (version === 2) {
// Vue v2.x.x
} else if (version === 1) {
// Vue v1.x.x
} else {
// Unsupported versions of Vue
}

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

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

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

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, key, value )

vm.$delete( target, key )

Instance Methods / Events

vm.$on( event, callback )

vm.$once( event, callback )

vm.$off( [event, callback] )

vm.$emit( event, […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-pre

v-cloak

v-once

Special Attributes

key

ref

slot

Built-In Components

component

transition

transition-group

keep-alive

slot

VNode Interface

Server-Side Rendering