Skip to content

Commit

Permalink
fix: scroller may be null in nuxt
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Feb 5, 2024
1 parent cc0c986 commit 6f72b75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/varlet-ui/src/back-top/BackTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export default defineComponent({
}
function removeScrollerEventListener() {
if (!scroller) {
return
}
scroller.removeEventListener('scroll', handleScroll)
}
Expand Down
4 changes: 4 additions & 0 deletions packages/varlet-ui/src/list/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export default defineComponent({
}

function removeScrollerListener() {
if (!scroller) {
return
}

scroller.removeEventListener('scroll', check)
}

Expand Down

0 comments on commit 6f72b75

Please sign in to comment.