[Vuejs]-Vue.js: Data is not updating on change

0👍

I thinks this is issue with context (this keyword).

channel.bind("price-raise", function (data) {
      // 'this' reference here is not the reference to vue-component
      this.price.value = data.price;
});

You should either use arrow-function…

channel.bind("price-raise",  (data) =>  this.price.value = data.price);

…or an old-school that lifehack:

var that = this;
channel.bind("price-raise", function (data) {
      that.price.value = data.price;
    });

Leave a comment