监测是否阅读完毕(是否滚动到底部)
this.$nextTick(() => {
const el = document.querySelector('.pdf_box');
const offsetHeight = el.offsetHeight;
el.onscroll = () => {
const scrollTop = el.scrollTop;
const scrollHeight = el.scrollHeight;
if ((offsetHeight + scrollTop) - scrollHeight >= -1) {
// 需要执行的代码
console.log('已滚动到底部')
this.read_all = true;
}
};
});