From a4634e0d468b865264381fa31acb2a4af87e2a9a Mon Sep 17 00:00:00 2001 From: haoziqaq <357229046@qq.com> Date: Wed, 19 Jan 2022 21:52:12 +0800 Subject: [PATCH] fix(ui/list): remove isHidden function --- packages/varlet-ui/src/list/List.vue | 6 +----- packages/varlet-ui/src/utils/elements.ts | 6 ------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/varlet-ui/src/list/List.vue b/packages/varlet-ui/src/list/List.vue index 607f0decc85..7d109b0a899 100644 --- a/packages/varlet-ui/src/list/List.vue +++ b/packages/varlet-ui/src/list/List.vue @@ -27,7 +27,7 @@ import VarLoading from '../loading' import Ripple from '../ripple' import { defineComponent, onMounted, onUnmounted, ref, nextTick } from 'vue' -import { getParentScroller, isHidden, toPxNum } from '../utils/elements' +import { getParentScroller, toPxNum } from '../utils/elements' import { props } from './props' import { isNumber, dt } from '../utils/shared' import { pack } from '../locale' @@ -64,10 +64,6 @@ export default defineComponent({ const check = async () => { await nextTick() - if (isHidden(listEl.value as HTMLElement)) { - return - } - const { loading, finished, error } = props if (!loading && !finished && !error && isReachBottom()) { diff --git a/packages/varlet-ui/src/utils/elements.ts b/packages/varlet-ui/src/utils/elements.ts index 34c43c9776a..d814e968677 100644 --- a/packages/varlet-ui/src/utils/elements.ts +++ b/packages/varlet-ui/src/utils/elements.ts @@ -42,12 +42,6 @@ export function getTranslate(el: HTMLElement) { return +transform.slice(transform.lastIndexOf(',') + 2, transform.length - 1) } -export function isHidden(el: HTMLElement) { - const { width, height } = el.getBoundingClientRect() - - return width === 0 && height === 0 -} - export function getParentScroller(el: HTMLElement): HTMLElement | Window { let element = el