Skip to content

usePageLeave

类别
导出体积
647 B
上次更改
6 minutes ago

响应式状态,用于显示鼠标是否离开页面。

示例

{
  "isLeft": false
}

使用方法

ts
import { 
usePageLeave
} from '@vueuse/core'
const
isLeft
=
usePageLeave
()

组件使用

vue
<template>
  <UsePageLeave v-slot="{ 
isLeft
}">
是否离开页面: {{
isLeft
}}
</UsePageLeave> </template>

类型声明

ts
export interface UsePageLeaveOptions extends ConfigurableWindow {}
export type 
UsePageLeaveReturn
=
ShallowRef
<boolean>
/** * 响应式状态,用于显示鼠标是否离开页面。 * * @see https://vueuse.org/usePageLeave * @param options * * @__NO_SIDE_EFFECTS__ */ export declare function
usePageLeave
(
options
?: UsePageLeaveOptions,
):
UsePageLeaveReturn

源码

源码演示文档

贡献者

一纸忘忧

更新日志

没有最近的更新日志