const doLogin = function (username, password, v, callback) { }; doLogin(localStorage.username, localStorage.password, this, function (res, msg) { if (res) { this.$store.commit({ type: 'login', username: res.name, token: res.token, }); });
this.$store这里的this指向不正确怎么把外层this绑定给这个回调函
相关分类