/*! For license information please see 4061.75121d2f.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["4061"],{60699:function(s,n,a){"use strict";a.r(n);var t=a("80681");let l=["innerHTML"];n.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'
\u83B7\u53D6\u5143\u7D20\u6700\u8FD1\u7684\u53EF\u6EDA\u52A8\u7236\u5143\u7D20\u3002
\n<div ref="root" />\n
\nimport { ref, watch } from 'vue';\nimport { useScrollParent, useEventListener } from '@vant/use';\n\nexport default {\n setup() {\n const root = ref();\n const scrollParent = useScrollParent(root);\n\n useEventListener(\n 'scroll',\n () => {\n console.log('scroll');\n },\n { target: scrollParent },\n );\n\n return { root };\n },\n};\n
\nfunction useScrollParent(\n element: Ref<Element | undefined>,\n): Ref<Element | Window | undefined>;\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
element | \n\u5F53\u524D\u5143\u7D20 | \nRef<Element> | \n- | \n
\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n
---|---|---|
scrollParent | \n\u6700\u8FD1\u7684\u53EF\u6EDA\u52A8\u7236\u5143\u7D20 | \nRef<Element> | \n