settimeout的this指向

blur: function () {
      let self = this;
      setTimeout(() => {
        this.isFoucs = true
      }, 200);
    }

 

setTimeout中所执行函数中的this,永远指向window!!注意是要延迟执行的函数中的this哦

posted @ 2020-05-12 01:43  shanjinghao  阅读(567)  评论(0编辑  收藏  举报