/*! For license information please see 5180.687d6962.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["5180"],{66721:function(s,a,n){"use strict";n.r(a);var i=n("80681");let l=["innerHTML"];a.default={setup:()=>({html:""}),render:()=>((0,i.wg)(),(0,i.iD)("div",{class:"van-doc-markdown-body",innerHTML:'

usePageVisibility

\n

\u4ECB\u7ECD

\n

\u83B7\u53D6\u9875\u9762\u7684\u53EF\u89C1\u72B6\u6001\u3002

\n

\u4EE3\u7801\u6F14\u793A

\n

\u57FA\u672C\u7528\u6CD5

\n
import { watch } from 'vue';\nimport { usePageVisibility } from '@vant/use';\n\nexport default {\n  setup() {\n    const pageVisibility = usePageVisibility();\n\n    watch(pageVisibility, (value) => {\n      console.log('visibility: ', value);\n    });\n  },\n};\n
\n

API

\n

\u7C7B\u578B\u5B9A\u4E49

\n
type VisibilityState = 'visible' | 'hidden';\n\nfunction usePageVisibility(): Ref<VisibilityState>;\n
\n

\u8FD4\u56DE\u503C

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53C2\u6570\u8BF4\u660E\u7C7B\u578B
visibilityState\u9875\u9762\u5F53\u524D\u7684\u53EF\u89C1\u72B6\u6001\uFF0Cvisible \u4E3A\u53EF\u89C1\uFF0Chidden \u4E3A\u9690\u85CFRef<VisibilityState>
\n
'},null,8,l))}}}]);