[Vuejs]-Vue.js set data in if statement of function

0👍

✅

The problem is that within those functions, this does not refer to your Vue instance. I would set up your functions like this:

login() {
  CH.INSTANCE.Services.Login(this.email, this.password, this.login_onComplete, this.login_onCancel);
},
login_onComplete(aUser) {
  window.location.href = '/';
},
login_onCancel(aMessage) {
  this.error =  aMessage ;
}

Leave a comment