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

\u7EC4\u5408\u5F0F API

\n

\u4ECB\u7ECD

\n

Vant \u5E95\u5C42\u4F9D\u8D56\u4E86 @vant/use \u5305\uFF0C\u5176\u4E2D\u5185\u7F6E\u4E86\u4E00\u7CFB\u5217\u7684\u7EC4\u5408\u5F0F API\u3002\u5BF9\u4E8E\u4F7F\u7528\u4E86 Vant \u7684\u9879\u76EE\uFF0C\u53EF\u4EE5\u590D\u7528\u8FD9\u4E9B API \u8FDB\u884C\u5F00\u53D1\u3002

\n

\u5B89\u88C5

\n

\u867D\u7136 Vant \u7684\u4F9D\u8D56\u4E2D\u5DF2\u7ECF\u5305\u542B\u4E86 @vant/use\uFF0C\u4F46\u6211\u4EEC\u4ECD\u7136\u63A8\u8350\u663E\u5F0F\u5730\u5B89\u88C5\u5B83\uFF1A

\n
# with npm\nnpm i @vant/use\n\n# with yarn\nyarn add @vant/use\n\n# with pnpm\npnpm add @vant/use\n\n# with Bun\nbun add @vant/use\n
\n

\u793A\u4F8B

\n

\u4E0B\u9762\u662F\u4E00\u4E2A Vant \u7EC4\u5408\u5F0F API \u7684\u7528\u6CD5\u793A\u4F8B\uFF0C\u6211\u4EEC\u4ECE @vant/use \u8FD9\u4E2A\u5305\u4E2D\u5F15\u5165 useWindowSize \u65B9\u6CD5\uFF0C\u7136\u540E\u8FDB\u884C\u8C03\u7528\uFF0C\u5373\u53EF\u83B7\u53D6\u5230\u5F53\u524D Window \u7684\u5BBD\u5EA6\u548C\u9AD8\u5EA6\u3002

\n
import { useWindowSize } from '@vant/use';\n\nconst { width, height } = useWindowSize();\n\nconsole.log(width.value); // -> \u7A97\u53E3\u5BBD\u5EA6\nconsole.log(height.value); // -> \u7A97\u53E3\u9AD8\u5EA6\n
\n

API \u5217\u8868

\n

\u4E0B\u9762\u662F Vant \u5BF9\u5916\u63D0\u4F9B\u7684\u6240\u6709\u7EC4\u5408\u5F0F API\uFF0C\u70B9\u51FB\u540D\u79F0\u53EF\u4EE5\u67E5\u770B\u8BE6\u7EC6\u4ECB\u7ECD\uFF1A

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u63CF\u8FF0
useClickAway\u76D1\u542C\u70B9\u51FB\u5143\u7D20\u5916\u90E8\u7684\u4E8B\u4EF6
useCountDown\u63D0\u4F9B\u5012\u8BA1\u65F6\u7BA1\u7406\u80FD\u529B
useCustomFieldValue\u81EA\u5B9A\u4E49\u8868\u5355\u7EC4\u4EF6\u4E2D\u7684\u8868\u5355\u9879
useEventListener\u65B9\u4FBF\u5730\u8FDB\u884C\u4E8B\u4EF6\u7ED1\u5B9A
usePageVisibility\u83B7\u53D6\u9875\u9762\u7684\u53EF\u89C1\u72B6\u6001
useRect\u83B7\u53D6\u5143\u7D20\u7684\u5927\u5C0F\u53CA\u5176\u76F8\u5BF9\u4E8E\u89C6\u53E3\u7684\u4F4D\u7F6E
useRelation\u5EFA\u7ACB\u7236\u5B50\u7EC4\u4EF6\u4E4B\u95F4\u7684\u5173\u8054\u5173\u7CFB
useScrollParent\u83B7\u53D6\u5143\u7D20\u6700\u8FD1\u7684\u53EF\u6EDA\u52A8\u7236\u5143\u7D20
useToggle\u7528\u4E8E\u5728\u5E03\u5C14\u503C\u4E4B\u95F4\u8FDB\u884C\u5207\u6362
useWindowSize\u83B7\u53D6\u6D4F\u89C8\u5668\u7A97\u53E3\u7684\u89C6\u53E3\u5BBD\u5EA6\u548C\u9AD8\u5EA6
useRaf\u63D0\u4F9BrequestAnimationFrame\u7BA1\u7406\u80FD\u529B
\n
'},null,8,e))}}}]);