全局配置

Vue.config 是一个包含 Vue 全局配置的对象。您可以在启动应用程序之前修改其下面列出的属性

debug

delimiters

unsafeDelimiters

silent

async

devtools

全局 API

Vue.extend( options )

Vue.nextTick( callback )

Vue.set( object, key, value )

Vue.delete( object, key )

Vue.directive( id, [definition] )

Vue.elementDirective( id, [definition] )

Vue.filter( id, [definition] )

Vue.component( id, [definition] )

Vue.transition( id, [hooks] )

Vue.partial( id, [partial] )

Vue.use( plugin, [options] )

Vue.mixin( mixin )

选项 / 数据

data

props

propsData

1.0.22+

computed

methods

watch

选项 / DOM

el

template

replace

选项 / 生命周期钩子

init

created

beforeCompile

compiled

activate

ready

attached

detached

beforeDestroy

destroyed

选项 / 资产

directives

elementDirectives

filters

components

transitions

partials

选项 / 杂项

parent

events

mixins

name

extends

1.0.22+

实例属性

vm.$data

vm.$el

vm.$options

vm.$parent

vm.$root

vm.$children

vm.$refs

vm.$els

实例方法 / 数据

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

注意:当修改(而不是替换)对象或数组时,旧值将与新值相同,因为它们引用的是同一个对象/数组。Vue 不会保留预修改值的副本。

vm.$get( expression )

vm.$set( keypath, value )

vm.$delete( key )

vm.$eval( expression )

vm.$interpolate( templateString )

vm.$log( [keypath] )

实例方法 / 事件

vm.$on( event, callback )

vm.$once( event, callback )

vm.$off( [event, callback] )

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

vm.$dispatch( event, […args] )

vm.$broadcast( event, […args] )

实例方法 / DOM

vm.$appendTo( elementOrSelector, [callback] )

vm.$before( elementOrSelector, [callback] )

vm.$after( elementOrSelector, [callback] )

vm.$remove( [callback] )

vm.$nextTick( callback )

实例方法 / 生命周期

vm.$mount( [elementOrSelector] )

vm.$destroy( [remove] )

指令

v-text

v-html

v-if

v-show

v-else

v-for

v-on

v-bind

v-model

v-ref

v-el

v-pre

v-cloak

特殊元素

component

slot

partial

过滤器

capitalize

uppercase

lowercase

currency

pluralize

json

debounce

limitBy

filterBy

orderBy

数组扩展方法

Vue.js 使用两个额外的函数扩展了 `Array.prototype`,这使得执行一些常见的数组操作变得更加容易,同时确保正确触发响应式更新。

array.$set(index, value)

array.$remove(reference)