diff --git a/src/hooks/web/useElementFullscreen.ts b/src/hooks/web/useElementFullscreen.ts index 3981dca4..395bade5 100644 --- a/src/hooks/web/useElementFullscreen.ts +++ b/src/hooks/web/useElementFullscreen.ts @@ -182,18 +182,16 @@ export const useElementFullscreen = ( const stopWatch = watch(() => height.value, updateStyle) - effectDispose({ - fc: () => { - const element = unrefElement(target) as HTMLElement | null + effectDispose(() => { + const element = unrefElement(target) as HTMLElement | null - if (element) { - element.style.transition = cacheStyle.transition ?? '' + if (element) { + element.style.transition = cacheStyle.transition ?? '' - element.removeAttribute(ID_TAG) - } + element.removeAttribute(ID_TAG) + } - stopWatch() - }, + stopWatch() }) return { diff --git a/src/utils/element.ts b/src/utils/element.ts index 0d5cc802..8a09e584 100644 --- a/src/utils/element.ts +++ b/src/utils/element.ts @@ -45,7 +45,7 @@ export const setClass = ( immediate: true, }) - effectDispose({ fc: watcher }) + effectDispose(watcher) } /** @@ -93,7 +93,7 @@ export const removeClass = ( immediate: true, }) - effectDispose({ fc: watcher }) + effectDispose(watcher) } /** @@ -140,7 +140,7 @@ export const hasClass = ( immediate: true, }) - effectDispose({ fc: watcher }) + effectDispose(watcher) return hasClassRef } @@ -250,7 +250,7 @@ export const setStyle = ( immediate: true, }) - effectDispose({ fc: watcher }) + effectDispose(watcher) } /** @@ -286,7 +286,7 @@ export const removeStyle = ( immediate: true, }) - effectDispose({ fc: watcher }) + effectDispose(watcher) } /** diff --git a/src/utils/vue/watchEffectWithTarget.ts b/src/utils/vue/watchEffectWithTarget.ts index f5b5c133..6427d389 100644 --- a/src/utils/vue/watchEffectWithTarget.ts +++ b/src/utils/vue/watchEffectWithTarget.ts @@ -34,5 +34,5 @@ export function watchEffectWithTarget( ) { const stop = watchEffect(fc, watchOptions) - effectDispose({ fc: stop }) + effectDispose(stop) }