let $this = this;
//定义Vue this 对象:then里的的this 指并非Vue
this.$http.post('/login', formData, config).then(res => {
console.log(res)
if (res.data.status === true) {
$this.$router.push({
name:"home",
});
} else {
$this.open("请先注册账号");
}
})
let $this = this;
//定义Vue this 对象:then里的的this 指并非Vue
this.$http.post('/login', formData, config).then(res => {
console.log(res)
if (res.data.status === true) {
$this.$router.push({
name:"home",
});
} else {
$this.open("请先注册账号");
}
})
转载于:https://www.cnblogs.com/shkj/p/8953682.html