Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/tryOnBeforeMount.md
1---2category: Component3---45# tryOnBeforeMount67Safe `onBeforeMount`. Call `onBeforeMount()` if it's inside a component lifecycle, if not, just call the function89## Usage1011```ts12import { tryOnBeforeMount } from '@vueuse/core'1314tryOnBeforeMount(() => {1516})17```1819## Type Declarations2021```ts22/**23* Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function24*25* @param fn26* @param sync if set to false, it will run in the nextTick() of Vue27* @param target28*/29export declare function tryOnBeforeMount(30fn: Fn,31sync?: boolean,32target?: ComponentInternalInstance | null,33): void34```35