摘要: watchEffect 1、使用哪个就监听哪个的值 : import { watchEffect,ref } from 'vue'; let message1 = ref<string>('明天你好') let message2 = ref<string>('加油') watchEffect(()= 阅读全文
posted @ 2023-01-06 17:16 sixpence1016 阅读(99) 评论(0) 推荐(0) 编辑
摘要: watch的基本用法: 也可以用数组的方式同时监听多个 深度监听: 使用ref需要开启深度监听才可以监听到里面的值 使用reactive不需要开启也可以监听到里面的值,因为源码就自己开启了深度监听 let message2 = ref({ name:'小明', age:18, foo:{ bar:' 阅读全文
posted @ 2023-01-06 15:30 sixpence1016 阅读(126) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示