前端高阶1 - Vue3 + TS - 10-watch侦听器 - 监听多个ref 注意变成数组

32 阅读1分钟
  • 监听多个ref 注意变成数组

    • let message = ref('')
    • let message2 = ref('')
    • watch([message,message2], (newVal, oldVal) => {

      • console.log('新的值----', newVal);
      • console.log('旧的值----', oldVal);
    • })