ElemeFE / ElemeFE/mint-ui

[Bug Report] Infinite scroll 挂在window的事件,应该在离开页面的时候,把事件注销掉

Open
#1,285 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
16.4k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

### Mint UI version
2.2.13

### OS/Browsers version
window/谷歌浏览器 63.0.3239.132

### Vue version
2.5.13

### Steps to reproduce
建立十个列表页,每个列表页使用 Infinite scroll

来回切换,看下window下挂载的scroll会不会变成十个。

对列表很多的移动端,很不友好

### What is Expected?
希望Infinite scroll注册的事件,到了第二个页面的时候,会被注销掉、。

不然,我有十个列表页, Infinite scroll 会给我生成十个window的scroll事件

### What is actually happening?
希望可以扩展一个方法,可以直接注销infinite scroll的方法

在deactivated、destroyed、beforeDestroy这三个生命周期中注销。

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the Infinite scroll component's window scroll listener and its Vue lifecycle handling. Reproduce the issue by switching among ten list pages, then verify that listeners are removed during deactivated, destroyed, or beforeDestroy and that an explicit unregister method behaves as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.