refactor: 优化智能分页检测和密钥复制交互

- 智能分页统一使用防抖检测避免与 ResizeObserver 双重触发
- 密钥名称仅在非空时启用复制功能
- 移除 API Key 不必要的危险字符校验
This commit is contained in:
fawney19
2026-02-09 19:05:29 +08:00
parent c6cd7d5ae6
commit 853c489471
3 changed files with 12 additions and 26 deletions

View File

@@ -127,13 +127,13 @@ export function useSmartPagination<T>(
function requestDetect() {
pendingDetect = true
// 先尝试立即检测
// 先尝试立即检测(快路径),统一走防抖避免与 ResizeObserver 双重触发
nextTick(() => {
const el = listRef.value
if (el && el.scrollHeight > 0) {
// DOM 已就绪,直接检测
// DOM 已就绪,通过防抖检测
pendingDetect = false
detect()
debouncedDetect()
}
// 否则等待 ResizeObserver 回调
})