당신보다 고작 하루 먼저 시작한 개발자의 오지랖

[VUE] watch에서 json 오브젝트 감시하기(특정 혹은 전체) 본문

VUE

[VUE] watch에서 json 오브젝트 감시하기(특정 혹은 전체)

hobbada 2022. 10. 6. 18:15

객체내 값 모두를 감시할 경우

 

watch: {
    object: {
      handler: function (val, oldVal) {
        console.log(val);
      },
      deep: true,
    },
  },

 

 

객체내 특정 값만 감시할 경우

 

 

watch: {
    "object.child": function (val) {
      console.log(val);
    },
  },
반응형
Comments