fix: Update useDestroyed.ts (#5361)

destroyed should be true not false
pull/5362/head
ysex 2022-03-19 10:19:37 +08:00 committed by GitHub
parent d1e2f4ff27
commit cc47bb66ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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;