parent
d1e2f4ff27
commit
cc47bb66ea
@ -1,12 +1,12 @@
|
|||||||
import { onBeforeUnmount, ref } from 'vue';
|
import { onBeforeUnmount, ref } from 'vue';
|
||||||
|
|
||||||
const useDestroyed = () => {
|
const useDestroyed = () => {
|
||||||
const mounted = ref(true);
|
const destroyed = ref(false);
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
mounted.value = false;
|
destroyed.value = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
return mounted;
|
return destroyed;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useDestroyed;
|
export default useDestroyed;
|
||||||
|
Loading…
Reference in new issue