watch: {
    option: {
        handler(newVal) {
            console.log(newVal);
        },
        deep: true,
        immediate: true
    }
},

需要深层watch就需要开启deep属性

开启immediate属性,设定为true,会打印一次初始值;

 

相关文章:

  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
猜你喜欢
  • 2023-01-05
  • 2021-09-19
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2018-09-29
相关资源
相似解决方案