2条回答 默认 最新
- 崽崽的谷雨 2021-06-11 09:56关注
this指向问题吧,如果是在箭头函数里调用this就需要用个变量接收一下,你把这个注释打印一下this看看
let _this=this; a=()=>{ }.then(res=>{ _this.aa() }) _this.aa... //这样 //或者用call,bind,apply改变this指向
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
this指向问题吧,如果是在箭头函数里调用this就需要用个变量接收一下,你把这个注释打印一下this看看
let _this=this;
a=()=>{
}.then(res=>{
_this.aa()
})
_this.aa... //这样
//或者用call,bind,apply改变this指向