Skip to content

usePageLeave

类别
导出体积
707 B
上次更改
1 hour ago

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

示例

{
  "isLeft": false
}

使用方法

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

组件使用

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

类型声明

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

源码

源码演示文档

贡献者

一纸忘忧

更新日志

没有最近的更新日志