From 498ea1108bb3f540645eaddebcc9953aa25f9779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Mon, 5 Sep 2022 10:10:44 +0800 Subject: [PATCH] chore: remove redundant stop --- packages/core/useElementVisibility/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/core/useElementVisibility/index.ts b/packages/core/useElementVisibility/index.ts index 167abffb006..9deac8c6ef5 100644 --- a/packages/core/useElementVisibility/index.ts +++ b/packages/core/useElementVisibility/index.ts @@ -1,5 +1,4 @@ import type { MaybeComputedRef } from '@vueuse/shared' -import { tryOnScopeDispose } from '@vueuse/shared' import { ref, watch } from 'vue-demi' import type { MaybeComputedElementRef } from '../unrefElement' import { unrefElement } from '../unrefElement' @@ -44,7 +43,7 @@ export function useElementVisibility( } } - const stop = watch( + watch( () => unrefElement(element), () => testBounding(), { immediate: true, flush: 'post' }, @@ -56,7 +55,5 @@ export function useElementVisibility( }) } - tryOnScopeDispose(() => stop()) - return elementIsVisible }