Skip to content

Commit

Permalink
修复 ##14775
Browse files Browse the repository at this point in the history
  • Loading branch information
nianwu committed Nov 29, 2023
1 parent 34c248f commit bb77597
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/infinite-scroll/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ const InfiniteScroll: ObjectDirective<InfiniteScrollEl, InfiniteScrollCallback>
container.addEventListener('scroll', onScroll)
},
unmounted(el) {
const { container, onScroll } = el[SCOPE]
if (SCOPE && el[SCOPE]) {
const container = el[SCOPE]
const onScroll = el[SCOPE]

container?.removeEventListener('scroll', onScroll)
container?.removeEventListener('scroll', onScroll)
}
destroyObserver(el)
},
}
Expand Down

0 comments on commit bb77597

Please sign in to comment.