惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
The Cloudflare Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
L
LangChain Blog
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
V
V2EX
I
InfoQ
博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
H
Help Net Security
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

博客园 - MvloveYouForever

添加gitignore mac安装小龙虾 flutter重新学习 uniapp简单移动端H5电脑端适配方案 添加ssh后,ssh-rsa fatal: Could not read git合并提交 cordova打印插件备注 H5开发类似rpx实现方法 maven仓库地址 idea与其他软件激活办法 linux常用命令总结 Command line is too long mysql安装教程备份 mybatis-plus 条件参数说明 关于打包electron应用 关于spring unicloud短信不能用 关于mybatis 关于maven 父子组件v-modle,vue2和vue3的区别 Vue3知识点
vue2 和 vue3的区别
MvloveYouForever · 2024-08-28 · via 博客园 - MvloveYouForever

1、选项式API和组合式API不同

2、组件通信书写方式不同,vue2通过props属性, vue3 通过 defineProps。 vue3中 v-model可以绑定多个属性,vue2中需要加 .sync实现多个双向绑定。

3、生命周期不同 vue2是: beforeCreate、created、beforeMount、mounted、beforeupdate、updated

    vue3是:setup开始创建组件、onBeforeMount、onMounted、onBeforeUpdate、onUpdated

4、vue3支持碎片、vue2不支持碎片。

5、vue2不能监听到对象中的属性的新增、删除需要用到this.$set。vue3中删除$set,属性删除和新增和响应式。

6、vue3中默认支持ts。