I'm using Element UI component in Vue.js and would like to add scroll management function to implement infinite scroll.
[This is a code of screenshot: Please take a look Example section] http://element.eleme.io/#/en-US/component/container
I tried the following code but infiniteScroll method was not called even if I scroll this section.
<el-main @scroll="infiniteScroll">......</el-main>
Also, I tried below as well, but it was not working because this page has two scrolls (in nav/content) and want to call infiniteScroll method when content is scrolled only.
created: function () {
window.addEventListener('scroll', this.infiniteScroll);
},
destroyed: function () {
window.removeEventListener('scroll', this.infiniteScroll);
}
Do you guys have the best solution?

refattribute to your mainel-mainelement, find thecontentand bind the scroll event listener to that element instead"TypeError: this.$refs.myInfiniteScroll.addEventListener is not a function"I changed it toidfromrefas Nomis's suggest, then it worked.