mounted() {
window.addEventListener('scroll', this.handleScroll, true);
},
destroyed() {
window.removeEventListener('scroll', this.handleScroll);
},
methods: {
handleScroll(e) {
if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight) {
}
},
}
Vue.directive('drop-down-loadmore',{
bind(el, binding) {
const SELECTWRAP_DOM = el;
SELECTWRAP_DOM.addEventListener('scroll', function() {
const condition =
SELECTWRAP_DOM.scrollHeight - SELECTWRAP_DOM.scrollTop <= SELECTWRAP_DOM.clientHeight;
if (condition) {
binding.value();
}
});
}
});