* 处理滚动事件
()
| 46 | * 处理滚动事件 |
| 47 | */ |
| 48 | handleScroll() { |
| 49 | if (this.scrollTimer) { |
| 50 | clearTimeout(this.scrollTimer) |
| 51 | } |
| 52 | |
| 53 | // 如果是程序性滚动,忽略此次事件 |
| 54 | if (this.isProgrammaticScroll) { |
| 55 | this.isProgrammaticScroll = false |
| 56 | return |
| 57 | } |
| 58 | |
| 59 | // 标记用户正在滚动 |
| 60 | this.isUserScrolling = true |
| 61 | |
| 62 | // 检查是否在底部 |
| 63 | this.shouldAutoScroll = this.isAtBottom() |
| 64 | |
| 65 | // 滚动结束后一段时间重置用户滚动状态 |
| 66 | this.scrollTimer = setTimeout(() => { |
| 67 | this.isUserScrolling = false |
| 68 | }, this.options.scrollDelay) |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * 等待 DOM 布局稳定 |
nothing calls this directly
no test coverage detected