本篇内容介绍了“Vue 2.0有哪些变化”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

高层级的变化
全局配置
Vue.config.silent
Vue.config.optionMergeStrategies
Vue.config.devtools
Vue.config.errorHandler(新API,全局的挂钩用于在组件渲染和监控的时候处理未捕获的错误)
Vue.config.keyCodes(新API,为v-on配置自定义的key的别名)
Vue.config.debug(已丢弃)
Vue.config.async(已丢弃)
Vue.config.delimiters(已丢弃)
Vue.config.unsafeDelimiters(已丢弃,使用v-html)
全局API
选项
data
。prop
。default
。coerce(已丢弃,如果你需要转换prop,请使用compute属性)
。prop binding modes(已丢弃,v-model在组件上可以工作
propsData(新API)只能用于实例
computed
methods
watch
DOM
生命周期钩子
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(已丢弃,同上)
Assets
directives
components
transitions
filters
partials(已丢弃)
elementDirectives(已丢弃)
杂项
实例方法
data
events
DOM
生命周期
指令
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被丢弃
。modifiers
。on child component
。自定义键码,目前版本Vue.config.keyCodes代替原来的Vue.directive('on').keyCodes
。作为prop
。xlink
。绑定对象
特殊组件
<component>
:is
async组件
inline-template
<transition>
<transition-group>
<keep-alive>
<slot>
partial(已丢弃)
特殊属性
服务器端渲染
renderToString
renderToStream
client-side hydration
“Vue 2.0有哪些变化”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注天达云网站,小编将为大家输出更多高质量的实用文章!