Skip to content

tryOnMounted

安全 onMounted。如果它在组件生命周期内,则调用 onMounted(),如果不在组件生命周期内,则仅调用该函数

¥Safe onMounted. Call onMounted() if it's inside a component lifecycle, if not, just call the function

用法

¥Usage

ts
import { 
tryOnMounted
} from '@vueuse/core'
tryOnMounted
(() => {
})