PeachScript / vue-infinite-loading

An infinite scroll plugin for Vue.js.
https://peachscript.github.io/vue-infinite-loading/
MIT License
2.66k stars 366 forks source link

Uncaught TypeError: Cannot read property 'addEventListener' of null #290

Open ruanhaojian opened 4 years ago

ruanhaojian commented 4 years ago

The error comes from :

setTimeout(() => {
  this.scrollHandler();
  this.scrollParent.addEventListener('scroll', this.scrollHandler, evt3rdArg);
}, 1);

when i use v-if direactive on this component, for example :

<infinite-loading
  v-if="isShow"
/>