[Vuejs]-Simple If return in VUE.JS method

0👍

In the login() method, you’re performing a comparison when you should actually assign a value to the loginFailed property:

this.loginFailed === true;

Change that line so that it actually assigns true to this.loginFailed:

this.loginFailed = true;

side note: You most likely don’t need to return anything from login() since it’s simply dealing with instance properties, you might want to remove this line:

return this.loginFailed

Leave a comment