[Vuejs]-Uncaught TypeError: Cannot read property '$router' of undefined

4👍

I think you lost your scope using function.

Solve it by using es6 syntax (if you can afford/using babel), (user) => { .. }.

Or by setting something like var _this = this; in the main login function and referencing that.

👤Jenne

Leave a comment