Merge pull request #2624 from SergioCrisostomo/check-for-element-before

check for element before using it
This commit is contained in:
Aresn 2017-12-14 19:43:56 +08:00 committed by GitHub
commit 52830ca693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,8 +228,8 @@
},
onScroll() {
if (this.isLoading) return;
const el = this.$refs.scrollContainer;
if (this.isLoading || !el) return;
const scrollDirection = Math.sign(this.lastScroll - el.scrollTop); // IE has no Math.sign, check that webpack polyfills this
const displacement = el.scrollHeight - el.clientHeight - el.scrollTop;