/*! For license information please see 5962.27f0976e.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["5962"],{56985: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:'

PullRefresh \u4E0B\u62C9\u5237\u65B0

\n

\u4ECB\u7ECD

\n

\u7528\u4E8E\u63D0\u4F9B\u4E0B\u62C9\u5237\u65B0\u7684\u4EA4\u4E92\u64CD\u4F5C\u3002

\n

\u5F15\u5165

\n

\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u6765\u5168\u5C40\u6CE8\u518C\u7EC4\u4EF6\uFF0C\u66F4\u591A\u6CE8\u518C\u65B9\u5F0F\u8BF7\u53C2\u8003\u7EC4\u4EF6\u6CE8\u518C\u3002

\n
import { createApp } from 'vue';\nimport { PullRefresh } from 'vant';\n\nconst app = createApp();\napp.use(PullRefresh);\n
\n

\u4EE3\u7801\u6F14\u793A

\n

\u57FA\u7840\u7528\u6CD5

\n

\u4E0B\u62C9\u5237\u65B0\u65F6\u4F1A\u89E6\u53D1 refresh \u4E8B\u4EF6\uFF0C\u5728\u4E8B\u4EF6\u7684\u56DE\u8C03\u51FD\u6570\u4E2D\u53EF\u4EE5\u8FDB\u884C\u540C\u6B65\u6216\u5F02\u6B65\u64CD\u4F5C\uFF0C\u64CD\u4F5C\u5B8C\u6210\u540E\u5C06 v-model \u8BBE\u7F6E\u4E3A false\uFF0C\u8868\u793A\u52A0\u8F7D\u5B8C\u6210\u3002

\n
<van-pull-refresh v-model="loading" @refresh="onRefresh">\n  <p>\u5237\u65B0\u6B21\u6570: {{ count }}</p>\n</van-pull-refresh>\n
\n
import { ref } from 'vue';\nimport { showToast } from 'vant';\n\nexport default {\n  setup() {\n    const count = ref(0);\n    const loading = ref(false);\n    const onRefresh = () => {\n      setTimeout(() => {\n        showToast('\u5237\u65B0\u6210\u529F');\n        loading.value = false;\n        count.value++;\n      }, 1000);\n    };\n\n    return {\n      count,\n      loading,\n      onRefresh,\n    };\n  },\n};\n
\n

\u6210\u529F\u63D0\u793A

\n

\u901A\u8FC7 success-text \u53EF\u4EE5\u8BBE\u7F6E\u5237\u65B0\u6210\u529F\u540E\u7684\u9876\u90E8\u63D0\u793A\u6587\u6848\u3002

\n
<van-pull-refresh\n  v-model="isLoading"\n  success-text="\u5237\u65B0\u6210\u529F"\n  @refresh="onRefresh"\n>\n  <p>\u5237\u65B0\u6B21\u6570: {{ count }}</p>\n</van-pull-refresh>\n
\n

\u81EA\u5B9A\u4E49\u63D0\u793A

\n

\u901A\u8FC7\u63D2\u69FD\u53EF\u4EE5\u81EA\u5B9A\u4E49\u4E0B\u62C9\u5237\u65B0\u8FC7\u7A0B\u4E2D\u7684\u63D0\u793A\u5185\u5BB9\u3002

\n
<van-pull-refresh v-model="isLoading" :head-height="80" @refresh="onRefresh">\n  <!-- \u4E0B\u62C9\u63D0\u793A\uFF0C\u901A\u8FC7 scale \u5B9E\u73B0\u4E00\u4E2A\u7F29\u653E\u6548\u679C -->\n  <template #pulling="props">\n    <img\n      class="doge"\n      src="https://fastly.jsdelivr.net/npm/@vant/assets/doge.png"\n      :style="{ transform: `scale(${props.distance / 80})` }"\n    />\n  </template>\n\n  <!-- \u91CA\u653E\u63D0\u793A -->\n  <template #loosing>\n    <img\n      class="doge"\n      src="https://fastly.jsdelivr.net/npm/@vant/assets/doge.png"\n    />\n  </template>\n\n  <!-- \u52A0\u8F7D\u63D0\u793A -->\n  <template #loading>\n    <img\n      class="doge"\n      src="https://fastly.jsdelivr.net/npm/@vant/assets/doge-fire.jpeg"\n    />\n  </template>\n  <p>\u5237\u65B0\u6B21\u6570: {{ count }}</p>\n</van-pull-refresh>\n\n<style>\n  .doge {\n    width: 140px;\n    height: 72px;\n    margin-top: 8px;\n    border-radius: 4px;\n  }\n</style>\n
\n

API

\n

Props

\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53C2\u6570\u8BF4\u660E\u7C7B\u578B\u9ED8\u8BA4\u503C
v-model\u662F\u5426\u5904\u4E8E\u52A0\u8F7D\u4E2D\u72B6\u6001boolean-
pulling-text\u4E0B\u62C9\u8FC7\u7A0B\u63D0\u793A\u6587\u6848string\u4E0B\u62C9\u5373\u53EF\u5237\u65B0...
loosing-text\u91CA\u653E\u8FC7\u7A0B\u63D0\u793A\u6587\u6848string\u91CA\u653E\u5373\u53EF\u5237\u65B0...
loading-text\u52A0\u8F7D\u8FC7\u7A0B\u63D0\u793A\u6587\u6848string\u52A0\u8F7D\u4E2D...
success-text\u5237\u65B0\u6210\u529F\u63D0\u793A\u6587\u6848string-
success-duration\u5237\u65B0\u6210\u529F\u63D0\u793A\u5C55\u793A\u65F6\u957F(ms)number | string500
animation-duration\u52A8\u753B\u65F6\u957Fnumber | string300
head-height\u9876\u90E8\u5185\u5BB9\u9AD8\u5EA6number | string50
pull-distance\u89E6\u53D1\u4E0B\u62C9\u5237\u65B0\u7684\u8DDD\u79BBnumber | string\u4E0E head-height \u4E00\u81F4
disabled\u662F\u5426\u7981\u7528\u4E0B\u62C9\u5237\u65B0booleanfalse
\n

Events

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u4E8B\u4EF6\u540D\u8BF4\u660E\u56DE\u8C03\u53C2\u6570
refresh\u4E0B\u62C9\u5237\u65B0\u65F6\u89E6\u53D1-
change\u62D6\u52A8\u65F6\u6216\u72B6\u6001\u6539\u53D8\u65F6\u89E6\u53D1{ status: string, distance: number }
\n

Slots

\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\u8BF4\u660E\u53C2\u6570
default\u81EA\u5B9A\u4E49\u5185\u5BB9-
normal\u975E\u4E0B\u62C9\u72B6\u6001\u65F6\u9876\u90E8\u5185\u5BB9-
pulling\u4E0B\u62C9\u8FC7\u7A0B\u4E2D\u9876\u90E8\u5185\u5BB9{ distance: number }
loosing\u91CA\u653E\u8FC7\u7A0B\u4E2D\u9876\u90E8\u5185\u5BB9{ distance: number }
loading\u52A0\u8F7D\u8FC7\u7A0B\u4E2D\u9876\u90E8\u5185\u5BB9{ distance: number }
success\u5237\u65B0\u6210\u529F\u63D0\u793A\u5185\u5BB9-
\n

\u7C7B\u578B\u5B9A\u4E49

\n

\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A

\n
import type { PullRefreshProps } from 'vant';\n
\n

\u4E3B\u9898\u5B9A\u5236

\n

\u6837\u5F0F\u53D8\u91CF

\n

\u7EC4\u4EF6\u63D0\u4F9B\u4E86\u4E0B\u5217 CSS \u53D8\u91CF\uFF0C\u53EF\u7528\u4E8E\u81EA\u5B9A\u4E49\u6837\u5F0F\uFF0C\u4F7F\u7528\u65B9\u6CD5\u8BF7\u53C2\u8003 ConfigProvider \u7EC4\u4EF6\u3002

\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\u9ED8\u8BA4\u503C\u63CF\u8FF0
--van-pull-refresh-head-height50px-
--van-pull-refresh-head-font-sizevar(--van-font-size-md)-
--van-pull-refresh-head-text-colorvar(--van-text-color-2)-
--van-pull-refresh-loading-icon-size16px-
\n

\u5E38\u89C1\u95EE\u9898

\n

PullRefresh \u7684\u5185\u5BB9\u672A\u586B\u6EE1\u5C4F\u5E55\u65F6\uFF0C\u53EA\u6709\u4E00\u90E8\u5206\u533A\u57DF\u53EF\u4EE5\u4E0B\u62C9\uFF1F

\n

\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C\u4E0B\u62C9\u533A\u57DF\u7684\u9AD8\u5EA6\u662F\u548C\u5185\u5BB9\u9AD8\u5EA6\u4FDD\u6301\u4E00\u81F4\u7684\uFF0C\u5982\u679C\u9700\u8981\u8BA9\u4E0B\u62C9\u533A\u57DF\u59CB\u7EC8\u4E3A\u5168\u5C4F\uFF0C\u53EF\u4EE5\u7ED9 PullRefresh \u8BBE\u7F6E\u4E00\u4E2A\u4E0E\u5C4F\u5E55\u5927\u5C0F\u76F8\u7B49\u7684\u6700\u5C0F\u9AD8\u5EA6\uFF1A

\n
<van-pull-refresh style="min-height: 100vh;" />\n
\n

PullRefresh \u7684\u89E6\u53D1\u6761\u4EF6\u662F\uFF1F

\n

PullRefresh \u7684\u89E6\u53D1\u6761\u4EF6\u662F\u300C\u7236\u7EA7\u6EDA\u52A8\u5143\u7D20\u7684\u6EDA\u52A8\u6761\u5728\u9876\u90E8\u4F4D\u7F6E\u300D\u3002

\n\n

\u5728\u684C\u9762\u7AEF\u65E0\u6CD5\u64CD\u4F5C\u7EC4\u4EF6\uFF1F

\n

\u53C2\u89C1\u684C\u9762\u7AEF\u9002\u914D\u3002

\n
'},null,8,l))}}}]);