首页前端开发VUEVue2.js迁移到Vue3.js的API变化

Vue2.js迁移到Vue3.js的API变化

时间2023-04-23 08:33:02发布访客分类VUE浏览942
导读:Vue2.js迁移到Vue3.js的API变化,-表示移除Vue2.jsVue3.jsnew Vue( createApp( Vue.extenddefineComponent or extendsVue.prototypeapp.conf...

Vue2.js迁移到Vue3.js的API变化,-表示移除

Vue2.jsVue3.js
new Vue()createApp()
Vue.extenddefineComponent or extends
Vue.prototypeapp.config.globalProperties
Vue.set-
Vue.delete-
Vue.observablereactive
config.keyCodes-
vm.$set-
vm.$delete-
vm.$on-
vm.$off-
vm.$once-
vm.$children-
vm.$listeners-
hook:x-
vm.$scopedSlots-
vm.$slotsnow exposes functions
$attrsnow includes class and style
datamust be a function in all cases
datafrom mixin or extension is now shallow merged
beforeDestroybeforeUnmount
destroyedunmounted
v-onno longer supports keyCode modifiers
-watching an array no longer triggers on mutation unless deep
-Custom directive hook names changed
-No longer removes attribute if binding value is boolean false
-No longer special case enumerated attributes
transition-group> no longer renders a root element by default
-Async component API changed (now requires defineAsyncComponent)
-Functional component API changed (now must be plain functions)
-Component v-model reworked
-Render function API changed
-Filters removed (this option affects only runtime filter APIs)
-is usage is now restricted to component> only
v-bind.syncreplaced by v-model with arguments
v-bind.propmodifier removed
v-bind=“object”is now order sensitive
v-on.nativemodifier removed
-ref in v-for (compiler support)
template> with no special directives now renders as native element
-filters (compiler support)

参考

https://v3-migration.vuejs.org/migration-build.html#fully-compatible


声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!

JavaScriptAPI

若转载请注明出处: Vue2.js迁移到Vue3.js的API变化
本文地址: https://pptw.com/jishu/6141.html
租用香港金融服务器好处有哪几个方面? 高频Vue面试题,建议收藏便于经常翻看1

游客 回复需填写必要信息