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/useOnline.md
1---2category: Sensors3---45# useOnline67Reactive online state. A wrapper of `useNetwork`.89## Usage1011```ts12import { useOnline } from '@vueuse/core'1314const online = useOnline()15```1617## Component Usage1819```vue20<template>21<UseOnline v-slot="{ isOnline }">22Is Online: {{ isOnline }}23</UseOnline>24</template>25```2627## Type Declarations2829```ts30/**31* Reactive online state.32*33* @see https://vueuse.org/useOnline34* @param options35*36* @__NO_SIDE_EFFECTS__37*/38export declare function useOnline(39options?: ConfigurableWindow,40): Readonly<ShallowRef<boolean>>41```42