tangjinzhou
3 years ago
3 changed files with 18 additions and 2 deletions
@ -0,0 +1,12 @@
|
||||
import { onBeforeUnmount, ref } from 'vue'; |
||||
|
||||
const useDestroyed = () => { |
||||
const mounted = ref(true); |
||||
onBeforeUnmount(() => { |
||||
mounted.value = false; |
||||
}); |
||||
|
||||
return mounted; |
||||
}; |
||||
|
||||
export default useDestroyed; |
Loading…
Reference in new issue