指南
链接
核心
插件
主题
安全 onUnmounted。如果 onUnmounted() 在组件生命周期内,则调用 onUnmounted(),如果不在组件生命周期内,则不执行任何操作
onUnmounted
onUnmounted()
¥Safe onUnmounted. Call onUnmounted() if it's inside a component lifecycle, if not, do nothing
¥Usage
import { tryOnUnmounted } from '@vueuse/core' tryOnUnmounted(() => { })