您当前的位置: 首页 > 

彭世瑜

暂无认证

  • 4浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

彭世瑜 发布时间:2022-08-26 17:30:13 ,浏览量:4

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

Vue2.jsVue3.jsnew Vue()createApp()Vue.extenddefineComponent or extendsVue.prototypeapp.config.globalPropertiesVue.set-Vue.delete-Vue.observablereactiveconfig.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 styledatamust be a function in all casesdatafrom mixin or extension is now shallow mergedbeforeDestroybeforeUnmountdestroyedunmountedv-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 attributesno 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 onlyv-bind.syncreplaced by v-model with argumentsv-bind.propmodifier removedv-bind=“object”is now order sensitivev-on.nativemodifier removed-ref in v-for (compiler support)with no special directives now renders as native element-filters (compiler support)

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

关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.0575s