diff --git a/packages/core/useElementBounding/index.ts b/packages/core/useElementBounding/index.ts index a1bbab62e22a..ee1ccd19f027 100644 --- a/packages/core/useElementBounding/index.ts +++ b/packages/core/useElementBounding/index.ts @@ -1,4 +1,4 @@ -import { ref } from 'vue-demi' +import { ref, watch } from 'vue-demi' import { useEventListener } from '../useEventListener' import type { MaybeElementRef } from '../unrefElement' import { unrefElement } from '../unrefElement' @@ -54,6 +54,8 @@ export function useElementBounding(target: MaybeElementRef) { update, ) + watch(() => unrefElement(target), ele => !ele && update()) + return { height, bottom,