/*! For license information please see 6920.6faacda8.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["6920"],{72155:function(n,s,t){"use strict";t.r(s);var a=t("80681");let e=["innerHTML"];s.default={setup:()=>({html:""}),render:()=>((0,a.wg)(),(0,a.iD)("div",{class:"van-doc-markdown-body",innerHTML:'
\u83B7\u53D6\u5143\u7D20\u7684\u5927\u5C0F\u53CA\u5176\u76F8\u5BF9\u4E8E\u89C6\u53E3\u7684\u4F4D\u7F6E\uFF0C\u7B49\u4EF7\u4E8E Element.getBoundingClientRect\u3002
\n<div ref="root" />\n
\nimport { ref, onMounted } from 'vue';\nimport { useRect } from '@vant/use';\n\nexport default {\n setup() {\n const root = ref();\n\n onMounted(() => {\n const rect = useRect(root);\n console.log(rect); // -> \u5143\u7D20\u7684\u5927\u5C0F\u53CA\u5176\u76F8\u5BF9\u4E8E\u89C6\u53E3\u7684\u4F4D\u7F6E\n });\n\n return { root };\n },\n};\n
\nfunction useRect(\n element: Element | Window | Ref<Element | Window | undefined>,\n): DOMRect;\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n
---|---|---|
width | \n\u5BBD\u5EA6 | \nnumber | \n
height | \n\u9AD8\u5EA6 | \nnumber | \n
top | \n\u9876\u90E8\u4E0E\u89C6\u56FE\u7A97\u53E3\u5DE6\u4E0A\u89D2\u7684\u8DDD\u79BB | \nnumber | \n
left | \n\u5DE6\u4FA7\u4E0E\u89C6\u56FE\u7A97\u53E3\u5DE6\u4E0A\u89D2\u7684\u8DDD\u79BB | \nnumber | \n
right | \n\u53F3\u4FA7\u4E0E\u89C6\u56FE\u7A97\u53E3\u5DE6\u4E0A\u89D2\u7684\u8DDD\u79BB | \nnumber | \n
bottom | \n\u5E95\u90E8\u4E0E\u89C6\u56FE\u7A97\u53E3\u5DE6\u4E0A\u89D2\u7684\u8DDD\u79BB | \nnumber | \n