ant-design-vue/components/_util/hooks/useDestroyed.ts

13 lines
220 B
TypeScript

import { onBeforeUnmount, ref } from 'vue';
const useDestroyed = () => {
const destroyed = ref(false);
onBeforeUnmount(() => {
destroyed.value = true;
});
return destroyed;
};
export default useDestroyed;