// 監視一個ref定義的響應式數據 watch(sum,(newValue,oldValue)=>{ console.log('sum變化了',newValue,oldValue) }),{immediate,true} // 監視多個ref定義的響應式數據 watch([sum,msg],(newValue,oldValue)=>{ console.log('sum或者msg變化了',newValue,oldValue) })
如果監視的是reactive定義的響應式數據,則無法正確獲得oldValue!!!
如果監視的是reactive定義的響應式數據,則默認開啟深度監視 { immediate,true }
