mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 05:29:01 +08:00
13 lines
234 B
TypeScript
13 lines
234 B
TypeScript
import { onBeforeUnmount, shallowRef } from 'vue';
|
|
|
|
const useDestroyed = () => {
|
|
const destroyed = shallowRef(false);
|
|
onBeforeUnmount(() => {
|
|
destroyed.value = true;
|
|
});
|
|
|
|
return destroyed;
|
|
};
|
|
|
|
export default useDestroyed;
|