Add comprehensive reference documentation for: - Vitest: environments, projects/workspaces, type testing, vi utilities - Pinia: HMR, Nuxt integration, SSR setup - Vue: built-in components (Transition, Teleport, Suspense, KeepAlive) and advanced directives
42 lines
568 B
Markdown
42 lines
568 B
Markdown
---
|
|
category: Sensors
|
|
---
|
|
|
|
# useOnline
|
|
|
|
Reactive online state. A wrapper of `useNetwork`.
|
|
|
|
## Usage
|
|
|
|
```ts
|
|
import { useOnline } from '@vueuse/core'
|
|
|
|
const online = useOnline()
|
|
```
|
|
|
|
## Component Usage
|
|
|
|
```vue
|
|
<template>
|
|
<UseOnline v-slot="{ isOnline }">
|
|
Is Online: {{ isOnline }}
|
|
</UseOnline>
|
|
</template>
|
|
```
|
|
|
|
## Type Declarations
|
|
|
|
```ts
|
|
/**
|
|
* Reactive online state.
|
|
*
|
|
* @see https://vueuse.org/useOnline
|
|
* @param options
|
|
*
|
|
* @__NO_SIDE_EFFECTS__
|
|
*/
|
|
export declare function useOnline(
|
|
options?: ConfigurableWindow,
|
|
): Readonly<ShallowRef<boolean>>
|
|
```
|