Skip to content

Commit 960ff1c

Browse files
author
Guillaume Chau
committed
feat(RecycleList): hidden event
1 parent 6f2980d commit 960ff1c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/components/RecycleList.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,15 @@ export default {
162162
},
163163
164164
handleVisibilityChange (isVisible, entry) {
165-
if (this.$_ready && (isVisible || entry.boundingClientRect.width !== 0 || entry.boundingClientRect.height !== 0)) {
166-
this.$emit('visible')
167-
requestAnimationFrame(() => {
168-
this.updateVisibleItems(false)
169-
})
165+
if (this.$_ready) {
166+
if (isVisible || entry.boundingClientRect.width !== 0 || entry.boundingClientRect.height !== 0) {
167+
this.$emit('visible')
168+
requestAnimationFrame(() => {
169+
this.updateVisibleItems(false)
170+
})
171+
} else {
172+
this.$emit('hidden')
173+
}
170174
}
171175
},
172176

0 commit comments

Comments
 (0)