Skip to content

Commit

Permalink
fix: handle exception occurred when the element doesn't exist (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
chatoo2412 authored and egoist committed Jun 24, 2019
1 parent 3474911 commit cedf6cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const MugenScroll = {
methods: {
checkInView() {
const execute = () => {
// The element can be removed
if (!this.$refs.scroll) {
return
}

const inView = inViewport(this.$refs.scroll, {
threshold: this.threshold
})
Expand Down

0 comments on commit cedf6cd

Please sign in to comment.