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/useMounted.md
1---2category: Component3---45# useMounted67Mounted state in ref.89## Usage1011```ts12import { useMounted } from '@vueuse/core'1314const isMounted = useMounted()15```1617Which is essentially a shorthand of:1819```ts20const isMounted = ref(false)2122onMounted(() => {23isMounted.value = true24})25```2627## Type Declarations2829```ts30/**31* Mounted state in ref.32*33* @see https://vueuse.org/useMounted34*35* @__NO_SIDE_EFFECTS__36*/37export declare function useMounted(): ShallowRef<boolean, boolean>38```39