this
.
$nextTick
(()
=>
{
const
el
=
document
.
querySelector
(
'.act-not'
);
const
offsetHeight
=
el
.
offsetHeight
;
el
.
onscroll
=
()
=>
{
const
scrollTop
=
el
.
scrollTop
;
const
scrollHeight
=
el
.
scrollHeight
;
if
((
offsetHeight
+
scrollTop
)
-
scrollHeight
>=
-
1
) {
// 需要执行的代码
}
};
});
坑:在做滚动加载分页时候,有时候第三方的弹窗如elementui 会出问题 ,这时候需要watch变量弹窗关闭时修改el.scrollTop=0即可