報錯如下:
vue Uncaught (in promise) TypeError: Cannot read property ‘dealLogin’ of undefined
原因如下:
.then(function (response) { //這裏不允許this
this.dealLogin(response);
}
改爲如下解決問題:
.then((response) => { //yes,完美,解決啦!看一下有什麼不同
this.dealLogin(response);
}