[Vuejs]-Why does calling a method that is an arrow function not work?

1👍

If you use an arrow function this will no longer reference the Vue instance. You need to use the function keyword here:

buttonClicked: function() {
    const newText = "The new value is" + Math.floor(Math.random() * 100);
    this.myLocalProperty = newText;
}

Leave a comment