13 lines
214 B
TypeScript
13 lines
214 B
TypeScript
|
import { onBeforeUnmount, ref } from 'vue';
|
||
|
|
||
|
const useDestroyed = () => {
|
||
|
const mounted = ref(true);
|
||
|
onBeforeUnmount(() => {
|
||
|
mounted.value = false;
|
||
|
});
|
||
|
|
||
|
return mounted;
|
||
|
};
|
||
|
|
||
|
export default useDestroyed;
|