模板解析器再也不依赖于DOM(除非你使用真正的DOM做为模板),所以只要你使用字符串模板,你将再也不受到任何1.0版本中的解析限制。可是,若是你依赖在存在的内容中挂载一个元素做为模板(使用el
元素),你将依然受到这些限制。html
编译器(将字符串模板转换为渲染方法的部分)和运行时间如今可以被分开。这里有两种不一样的构建:vue
独立构建:包括编译而且运行。这种方式和vue 1.0
几乎彻底同样。git
运行时编译:因为它不包括编译器,在编译步骤时要么预编译模板,要么手动编写渲染功能。npm包默认导出这个版本,那么你须要有一个编译的过程(使用Browserify
或Webpack
),从中vueify
或vue-loader
将能够进行模板预编译。github
Vue.config.silent
vue-router
Vue.config.optionMergeStrategies
vuex
Vue.config.devtools
npm
Vue.config.errorHandler
(新API,全局的挂钩用于在组件渲染和监控的时候处理未捕获的错误)数组
Vue.config.keyCodes
(新API,为v-on
配置自定义的key
的别名)服务器
(已丢弃)appVue.config.debug
(已丢弃)Vue.config.async
(已丢弃)Vue.config.delimiters
(已丢弃,使用Vue.config.unsafeDelimiters
v-html
)
Vue.extend
Vue.nextTick
Vue.set
Vue.delete
Vue.directive
Vue.component
Vue.use
Vue.mixin
Vue.compile
(新API,只能用于独立版本构建)
Vue.transition
(已丢弃,在stagger
el
上设置
Vue.filter
(已丢弃,使用组件)Vue.elementDirective
(已丢弃,使用功能组件)Vue.partial
data
props
prop
default
(已丢弃,若是你须要转换coerce
prop
,请使用compute
属性)
(已丢弃,prop binding modes
v-model
在组件上能够工做
propsData
(新API)只能用于实例
computed
methods
watch
el
template
render
(新API)
(已丢弃,组件如今必须有一个根元素)replace
(已丢弃,请使用init
beforeCreate
)
created
beforeDestroy
destroyed
beforeMount
(新API)
mounted
(新API)
beforeUpdate
(新API)
updated
(新API)
activated
(新API,用于keep-alive
)
deactivated
(新API用于keep-alive
)
(已丢弃,使用ready
mounted
)
(已丢弃,迁移到activate
vue-router
)
(已丢弃,使用beforeCompile
created
)
(已丢弃,使用compiled
mounted
)
(已丢弃)attached
(已丢弃,同上)detached
directives
components
transitions
filters
(已丢弃)partials
(已丢弃)elementDirectives
parent
mixins
name
extends
delimiters
(新API,替代原版的全局配置选项,只在独立构建中可用)
functional
(新API)
(已丢弃)events
vm.$watch
(已丢弃,直接检索值)vm.$get
(已丢弃,使用vm.$set
Vue.set
)
(已丢弃,使用vm.$delete
Vue.delete
)
(已丢弃,没有真正的使用)vm.$eval
(已丢弃,同上)vm.$interpolate
(已丢弃,使用vm.$log
devtools
)
vm.$on
vm.$once
vm.$off
vm.$emit
(已丢弃,使用全局的事件或使用vm.$dispatch
vuex
,见下面)
(已丢弃,同上)vm.$broadcast
vm.$nextTick
(已丢弃,在vm.$appendTo
vm.$el
上使用本地API)
(已丢弃)vm.$before
(已丢弃)vm.$after
(已丢弃)vm.$remove
vm.$mount
vm.$destroy
v-text
v-html
(注意{{{ }}}
被丢弃)
v-if
v-show
v-else
v-for
key
(替代 track-by
)
object v-for
range v-for
参数顺序更新:数组中使用(value, index) in arr
,对象中使用(value, key, index) in obj
和$index
被丢弃$key
v-on
modifiers
on child component
自定义键码,目前版本Vue.config.keyCodes
代替原来的Vue.directive('on').keyCodes
v-bind
做为prop
xlink
绑定对象
v-bind:style
prefix sniffing
v-bind:class
v-model
lazy
(as modifier)
number
(as modifier)
ignoring composition events
(已丢弃,使用debounce
v-on:input
)
v-cloak
v-pre
v-once
(新API)
(已丢弃,如今只是一个特殊的属性v-ref
ref
)
(和v-el
ref
合并)
<component>
:is
async组件
inline-template
<transition>
<transition-group>
<keep-alive>
<slot>
(已丢弃)partial
key
ref
slot
renderToString
renderToStream
client-side hydration
翻译自2.0 Changes