useOnline
Reactive online state. A wrapper of useNetwork
Demo
Usage
js
import { useOnline } from '@vueuse/core'
const online = useOnline()
import { useOnline } from '@vueuse/core'
const online = useOnline()
Component Usage
This function also provides a renderless component version via the
@vueuse/components
package. Learn more about the usage.
html
<UseOnline v-slot="{ isOnline }">
Is Online: {{ isOnline }}
</UseOnline>
<UseOnline v-slot="{ isOnline }">
Is Online: {{ isOnline }}
</UseOnline>
Type Declarations
typescript
/**
* Reactive online state.
*
* @see https://vueuse.org/useOnline
* @param options
*/
export declare function useOnline(options?: ConfigurableWindow): Ref<boolean>
/**
* Reactive online state.
*
* @see https://vueuse.org/useOnline
* @param options
*/
export declare function useOnline(options?: ConfigurableWindow): Ref<boolean>
Source
Contributors
Anthony Fu
vaakian X
Mike Jules
wheat
Alex Kozack
Antério Vieira