mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Sticky): error when unmounted #7169
This commit is contained in:
parent
195f3ffea1
commit
10cfb36636
@ -1,5 +1,11 @@
|
|||||||
import { inBrowser } from '../utils';
|
import { inBrowser } from '../utils';
|
||||||
import { Ref, onMounted, onUnmounted, onActivated, onDeactivated } from 'vue';
|
import {
|
||||||
|
Ref,
|
||||||
|
onMounted,
|
||||||
|
onActivated,
|
||||||
|
onDeactivated,
|
||||||
|
onBeforeUnmount,
|
||||||
|
} from 'vue';
|
||||||
|
|
||||||
export function useVisibilityChange(
|
export function useVisibilityChange(
|
||||||
target: Ref<Element>,
|
target: Ref<Element>,
|
||||||
@ -30,6 +36,6 @@ export function useVisibilityChange(
|
|||||||
|
|
||||||
onMounted(observe);
|
onMounted(observe);
|
||||||
onActivated(observe);
|
onActivated(observe);
|
||||||
onUnmounted(unobserve);
|
|
||||||
onDeactivated(unobserve);
|
onDeactivated(unobserve);
|
||||||
|
onBeforeUnmount(unobserve);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user