Skip to content

Commit dd2a523

Browse files
baiyaaaaafurybean
authored andcommitted
fix unbind bug (#58)
1 parent 07fbb42 commit dd2a523

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/directive.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ var doBind = function () {
9797
directive.scrollListener = throttle(doCheck.bind(directive), 200);
9898
directive.scrollEventTarget.addEventListener('scroll', directive.scrollListener);
9999

100+
this.vm.$on('hook:beforeDestroy', function () {
101+
directive.scrollEventTarget.removeEventListener('scroll', directive.scrollListener);
102+
});
103+
100104
var disabledExpr = element.getAttribute('infinite-scroll-disabled');
101105
var disabled = false;
102106

0 commit comments

Comments
 (0)