props: { example: { type: , default() { }, }, }, watch: { example: function(newVal,oldVal){ // newVal 为改变后的值 // 继续要处理的事件 }, },
使用watch 替代 mounted。
通过watch属性来响应数据的变化,当数据改变时执行异步操作。
继续阅读与本文标签相同的文章
-
Linux CentOS7 httpd 服务配置注释
2026-05-19栏目: 教程
-
linux端口查询
2026-05-19栏目: 教程
-
【Shell】检查软件包是否安装
2026-05-19栏目: 教程
-
X-Pack Spark 监控指标详解
2026-05-19栏目: 教程
-
招募令:阿里云MVP全球招募中,我们的征途是星辰大海!
2026-05-19栏目: 教程
