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/usePageLeave.md
1---2category: Sensors3---45# usePageLeave67Reactive state to show whether the mouse leaves the page.89## Usage1011```ts12import { usePageLeave } from '@vueuse/core'1314const isLeft = usePageLeave()15```1617## Component Usage1819```vue20<template>21<UsePageLeave v-slot="{ isLeft }">22Has Left Page: {{ isLeft }}23</UsePageLeave>24</template>25```2627## Type Declarations2829```ts30export interface UsePageLeaveOptions extends ConfigurableWindow {}31export type UsePageLeaveReturn = ShallowRef<boolean>32/**33* Reactive state to show whether mouse leaves the page.34*35* @see https://vueuse.org/usePageLeave36* @param options37*38* @__NO_SIDE_EFFECTS__39*/40export declare function usePageLeave(41options?: UsePageLeaveOptions,42): UsePageLeaveReturn43```44