为什么箭头函数里面的赋值不成功,但是匿名函数里面的可以
来源:6-5 歌手详情数据抓取
 
			目訫
2020-02-09
let _this = this
// 匿名函数
_this.$refs.player.addEventListener('canplay', function () {
  _this.duration = this.duration
}, false)
// 箭头函数
_this.$refs.player.addEventListener('canplay', () => {
  _this.duration = this.duration
}, false)请教一下老师为什么
写回答
	1回答
- 
				
				匿名函数会有问题吧,匿名函数中的 this.duration 的 this 不会指向组件实例 10
相似问题
