app.directive('scroll-bottom', {
mounted(el, binding) {
let timer: ReturnType<typeof setTimeout> | null = null;
let preScrollTop = 0;
el.addEventListener('scroll', () => {
if (el.scrollHeight - el.scrollTop - 20 <= el.clientHeight && el.scrollTop > preScrollTop) {
console.log('bottom');
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(() => {
binding.value();
}, 300);
}
preScrollTop = el.scrollTop;
});
},
});
enter image description here
Why is this error reported? I have a semicolon at the end of line 59.
I checked all the lines in this file and there is a semicolon at the end of each line.
dia anyone can help me?
Hope the code runs correctly.
New contributor