Vue -- addEventListener和removeEventListener注意事项
时间:2020-04-13 13:49:18
收藏:0
阅读:265
a.addEventListener(‘event‘, function, true/false)
a.removeEventListener(‘event‘, function, true/false)
1. 不要监听匿名函数;
2. 确保监听的函数和取消监听的函数是同一个函数;
3. 当removeEventListener不生效时,添加第三个参数试试;
原文:https://www.cnblogs.com/yanghana/p/12690702.html
评论(0)