指南
链接
核心
插件
主题
安全 onBeforeMount。如果它在组件生命周期内,则调用 onBeforeMount(),如果不在组件生命周期内,则仅调用该函数
onBeforeMount
onBeforeMount()
¥Safe onBeforeMount. Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function
¥Usage
import { tryOnBeforeMount } from '@vueuse/core' tryOnBeforeMount(() => { })