// 监听一个ref定义的数据
watch(num, (newValue, oldValue) => {
console.log("num增加了", newValue, oldValue);
},{ immediate: true, deep: true });
// 监听多个ref定义的数据
watch([num, num1], (newValue, oldValue) => {
console.log("num增加了", newValue, oldValue);
});
vue 3.0 ref Watch
于 2022-02-11 11:34:30 首次发布