[Vuejs]-Watch not update change vue

3👍

If you want to add new property to customer object you need to use set, otherwise it’s not reactive.

this.$set(this.customer, 'creditsLeft', newVal)

https://v2.vuejs.org/v2/guide/reactivity.html

Or you can set it before hand so you don’t need to use set

data() {
   customer: {
      creditsLeft: 0
   },
}
👤artoju

Leave a comment