/*! For license information please see 9393.13d4be4f.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["9393"],{47399: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:'
\u5F39\u51FA\u5C42\u5BB9\u5668\uFF0C\u7528\u4E8E\u5C55\u793A\u5F39\u7A97\u3001\u4FE1\u606F\u63D0\u793A\u7B49\u5185\u5BB9\uFF0C\u652F\u6301\u591A\u4E2A\u5F39\u51FA\u5C42\u53E0\u52A0\u5C55\u793A\u3002
\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
\nimport { createApp } from 'vue';\nimport { Popup } from 'vant';\n\nconst app = createApp();\napp.use(Popup);\n
\n\u901A\u8FC7 v-model:show
\u63A7\u5236\u5F39\u51FA\u5C42\u662F\u5426\u5C55\u793A\u3002
<van-cell title="\u5C55\u793A\u5F39\u51FA\u5C42" is-link @click="showPopup" />\n<van-popup v-model:show="show" :style="{ padding: '64px' }">\u5185\u5BB9</van-popup>\n
\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const show = ref(false);\n const showPopup = () => {\n show.value = true;\n };\n return {\n show,\n showPopup,\n };\n },\n};\n
\n\u901A\u8FC7 position
\u5C5E\u6027\u8BBE\u7F6E\u5F39\u7A97\u7684\u5F39\u51FA\u4F4D\u7F6E\uFF0C\u9ED8\u8BA4\u4E3A\u5C45\u4E2D\u5F39\u51FA\uFF0C\u53EF\u4EE5\u8BBE\u7F6E\u4E3A top
\u3001bottom
\u3001left
\u3001right
\u3002
<!-- \u9876\u90E8\u5F39\u51FA -->\n<van-popup v-model:show="showTop" position="top" :style="{ height: '30%' }" />\n\n<!-- \u5E95\u90E8\u5F39\u51FA -->\n<van-popup\n v-model:show="showBottom"\n position="bottom"\n :style="{ height: '30%' }"\n/>\n\n<!-- \u5DE6\u4FA7\u5F39\u51FA -->\n<van-popup\n v-model:show="showLeft"\n position="left"\n :style="{ width: '30%', height: '100%' }"\n/>\n\n<!-- \u53F3\u4FA7\u5F39\u51FA -->\n<van-popup\n v-model:show="showRight"\n position="right"\n :style="{ width: '30%', height: '100%' }"\n/>\n
\n\u8BBE\u7F6E closeable
\u5C5E\u6027\u540E\uFF0C\u4F1A\u5728\u5F39\u51FA\u5C42\u7684\u53F3\u4E0A\u89D2\u663E\u793A\u5173\u95ED\u56FE\u6807\uFF0C\u5E76\u4E14\u53EF\u4EE5\u901A\u8FC7 close-icon
\u5C5E\u6027\u81EA\u5B9A\u4E49\u56FE\u6807\uFF0C\u4F7F\u7528 close-icon-position
\u5C5E\u6027\u53EF\u4EE5\u81EA\u5B9A\u4E49\u56FE\u6807\u4F4D\u7F6E\u3002
<van-popup\n v-model:show="show"\n closeable\n position="bottom"\n :style="{ height: '30%' }"\n/>\n<!-- \u81EA\u5B9A\u4E49\u56FE\u6807 -->\n<van-popup\n v-model:show="show"\n closeable\n close-icon="close"\n position="bottom"\n :style="{ height: '30%' }"\n/>\n<!-- \u56FE\u6807\u4F4D\u7F6E -->\n<van-popup\n v-model:show="show"\n closeable\n close-icon-position="top-left"\n position="bottom"\n :style="{ height: '30%' }"\n/>\n
\n\u8BBE\u7F6E round
\u5C5E\u6027\u540E\uFF0C\u5F39\u7A97\u4F1A\u6839\u636E\u5F39\u51FA\u4F4D\u7F6E\u6DFB\u52A0\u4E0D\u540C\u7684\u5706\u89D2\u6837\u5F0F\u3002
<!-- \u5706\u89D2\u5F39\u7A97\uFF08\u5C45\u4E2D\uFF09 -->\n<van-popup v-model:show="showCenter" round :style="{ padding: '64px' }" />\n\n<!-- \u5706\u89D2\u5F39\u7A97\uFF08\u5E95\u90E8\uFF09 -->\n<van-popup\n v-model:show="showBottom"\n round\n position="bottom"\n :style="{ height: '30%' }"\n/>\n
\nPopup \u652F\u6301\u4EE5\u4E0B\u70B9\u51FB\u4E8B\u4EF6\uFF1A
\nclick
: \u70B9\u51FB\u5F39\u51FA\u5C42\u65F6\u89E6\u53D1\u3002click-overlay
: \u70B9\u51FB\u906E\u7F69\u5C42\u65F6\u89E6\u53D1\u3002click-close-icon
: \u70B9\u51FB\u5173\u95ED\u56FE\u6807\u65F6\u89E6\u53D1\u3002<van-cell title="\u76D1\u542C\u70B9\u51FB\u4E8B\u4EF6" is-link @click="show = true" />\n<van-popup\n v-model:show="show"\n position="bottom"\n :style="{ height: '30%' }"\n closeable\n @click-overlay="onClickOverlay"\n @click-close-icon="onClickCloseIcon"\n/>\n
\nimport { ref } from 'vue';\nimport { showToast } from 'vant';\n\nexport default {\n setup() {\n const show = ref(false);\n const onClickOverlay = () => {\n showToast('click-overlay');\n };\n const onClickCloseIcon = () => {\n showToast('click-close-icon');\n };\n return {\n show,\n onClickOverlay,\n onClickCloseIcon,\n };\n },\n};\n
\n\u5F53 Popup \u88AB\u6253\u5F00\u6216\u5173\u95ED\u65F6\uFF0C\u4F1A\u89E6\u53D1\u4EE5\u4E0B\u4E8B\u4EF6\uFF1A
\nopen
: \u6253\u5F00\u5F39\u51FA\u5C42\u65F6\u7ACB\u5373\u89E6\u53D1\u3002opened
: \u6253\u5F00\u5F39\u51FA\u5C42\u4E14\u52A8\u753B\u7ED3\u675F\u540E\u89E6\u53D1\u3002close
: \u5173\u95ED\u5F39\u51FA\u5C42\u65F6\u7ACB\u5373\u89E6\u53D1\u3002closed
: \u5173\u95ED\u5F39\u51FA\u5C42\u4E14\u52A8\u753B\u7ED3\u675F\u540E\u89E6\u53D1\u3002<van-cell title="\u76D1\u542C\u663E\u793A\u4E8B\u4EF6" is-link @click="show = true" />\n<van-popup\n v-model:show="show"\n position="bottom"\n :style="{ height: '30%' }"\n @open="showToast('open')"\n @opened="showToast('opened')"\n @close="showToast('close')"\n @closed="showToast('closed')"\n/>\n
\nimport { ref } from 'vue';\nimport { showToast } from 'vant';\n\nexport default {\n setup() {\n const show = ref(false);\n return {\n show,\n showToast,\n };\n },\n};\n
\n\u5F39\u51FA\u5C42\u9ED8\u8BA4\u6302\u8F7D\u5230\u7EC4\u4EF6\u6807\u7B7E\u6240\u5728\u4F4D\u7F6E\uFF0C\u53EF\u4EE5\u901A\u8FC7 teleport
\u5C5E\u6027\u6307\u5B9A\u6302\u8F7D\u4F4D\u7F6E\u3002
<!-- \u6302\u8F7D\u5230 body \u8282\u70B9\u4E0B -->\n<van-popup v-model:show="show" teleport="body" />\n\n<!-- \u6302\u8F7D\u5230 #app \u8282\u70B9\u4E0B -->\n<van-popup v-model:show="show" teleport="#app" />\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
v-model:show | \n\u662F\u5426\u663E\u793A\u5F39\u51FA\u5C42 | \nboolean | \nfalse | \n
overlay | \n\u662F\u5426\u663E\u793A\u906E\u7F69\u5C42 | \nboolean | \ntrue | \n
position | \n\u5F39\u51FA\u4F4D\u7F6E\uFF0C\u53EF\u9009\u503C\u4E3A top bottom right left | \nstring | \ncenter | \n
overlay-class | \n\u81EA\u5B9A\u4E49\u906E\u7F69\u5C42\u7C7B\u540D | \nstring | Array | object | \n- | \n
overlay-style | \n\u81EA\u5B9A\u4E49\u906E\u7F69\u5C42\u6837\u5F0F | \nobject | \n- | \n
duration | \n\u52A8\u753B\u65F6\u957F\uFF0C\u5355\u4F4D\u79D2\uFF0C\u8BBE\u7F6E\u4E3A 0 \u53EF\u4EE5\u7981\u7528\u52A8\u753B | \nnumber | string | \n0.3 | \n
z-index | \n\u5C06\u5F39\u7A97\u7684 z-index \u5C42\u7EA7\u8BBE\u7F6E\u4E3A\u4E00\u4E2A\u56FA\u5B9A\u503C | \nnumber | string | \n2000+ | \n
round | \n\u662F\u5426\u663E\u793A\u5706\u89D2 | \nboolean | \nfalse | \n
lock-scroll | \n\u662F\u5426\u9501\u5B9A\u80CC\u666F\u6EDA\u52A8 | \nboolean | \ntrue | \n
lazy-render | \n\u662F\u5426\u5728\u663E\u793A\u5F39\u5C42\u65F6\u624D\u6E32\u67D3\u8282\u70B9 | \nboolean | \ntrue | \n
close-on-popstate | \n\u662F\u5426\u5728\u9875\u9762\u56DE\u9000\u65F6\u81EA\u52A8\u5173\u95ED | \nboolean | \nfalse | \n
close-on-click-overlay | \n\u662F\u5426\u5728\u70B9\u51FB\u906E\u7F69\u5C42\u540E\u5173\u95ED | \nboolean | \ntrue | \n
closeable | \n\u662F\u5426\u663E\u793A\u5173\u95ED\u56FE\u6807 | \nboolean | \nfalse | \n
close-icon | \n\u5173\u95ED\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 name \u5C5E\u6027 | \nstring | \ncross | \n
close-icon-position | \n\u5173\u95ED\u56FE\u6807\u4F4D\u7F6E\uFF0C\u53EF\u9009\u503C\u4E3A top-left bottom-left bottom-right | \nstring | \ntop-right | \n
before-close | \n\u5173\u95ED\u524D\u7684\u56DE\u8C03\u51FD\u6570\uFF0C\u8FD4\u56DE false \u53EF\u963B\u6B62\u5173\u95ED\uFF0C\u652F\u6301\u8FD4\u56DE Promise | \n(action: string) => boolean | Promise<boolean> | \n- | \n
icon-prefix | \n\u56FE\u6807\u7C7B\u540D\u524D\u7F00\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 class-prefix \u5C5E\u6027 | \nstring | \nvan-icon | \n
transition | \n\u52A8\u753B\u7C7B\u540D\uFF0C\u7B49\u4EF7\u4E8E transition \u7684 name \u5C5E\u6027 | \nstring | \n- | \n
transition-appear | \n\u662F\u5426\u5728\u521D\u59CB\u6E32\u67D3\u65F6\u542F\u7528\u8FC7\u6E21\u52A8\u753B | \nboolean | \nfalse | \n
teleport | \n\u6307\u5B9A\u6302\u8F7D\u7684\u8282\u70B9\uFF0C\u7B49\u540C\u4E8E Teleport \u7EC4\u4EF6\u7684 to \u5C5E\u6027 | \nstring | Element | \n- | \n
safe-area-inset-top | \n\u662F\u5426\u5F00\u542F\u9876\u90E8\u5B89\u5168\u533A\u9002\u914D | \nboolean | \nfalse | \n
safe-area-inset-bottom | \n\u662F\u5426\u5F00\u542F\u5E95\u90E8\u5B89\u5168\u533A\u9002\u914D | \nboolean | \nfalse | \n
\u4E8B\u4EF6\u540D | \n\u8BF4\u660E | \n\u56DE\u8C03\u53C2\u6570 | \n
---|---|---|
click | \n\u70B9\u51FB\u5F39\u51FA\u5C42\u65F6\u89E6\u53D1 | \nevent: MouseEvent | \n
click-overlay | \n\u70B9\u51FB\u906E\u7F69\u5C42\u65F6\u89E6\u53D1 | \nevent: MouseEvent | \n
click-close-icon | \n\u70B9\u51FB\u5173\u95ED\u56FE\u6807\u65F6\u89E6\u53D1 | \nevent: MouseEvent | \n
open | \n\u6253\u5F00\u5F39\u51FA\u5C42\u65F6\u7ACB\u5373\u89E6\u53D1 | \n- | \n
close | \n\u5173\u95ED\u5F39\u51FA\u5C42\u65F6\u7ACB\u5373\u89E6\u53D1 | \n- | \n
opened | \n\u6253\u5F00\u5F39\u51FA\u5C42\u4E14\u52A8\u753B\u7ED3\u675F\u540E\u89E6\u53D1 | \n- | \n
closed | \n\u5173\u95ED\u5F39\u51FA\u5C42\u4E14\u52A8\u753B\u7ED3\u675F\u540E\u89E6\u53D1 | \n- | \n
\u540D\u79F0 | \n\u8BF4\u660E | \n
---|---|
default | \n\u5F39\u7A97\u5185\u5BB9 | \n
overlay-content | \n\u906E\u7F69\u5C42\u7684\u5185\u5BB9 | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type {\n PopupProps,\n PopupPosition,\n PopupInstance,\n PopupCloseIconPosition,\n} from 'vant';\n
\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\u540D\u79F0 | \n\u9ED8\u8BA4\u503C | \n\u63CF\u8FF0 | \n
---|---|---|
--van-popup-background | \nvar(--van-background-2) | \n- | \n
--van-popup-transition | \ntransform var(--van-duration-base) | \n- | \n
--van-popup-round-radius | \n16px | \n- | \n
--van-popup-close-icon-size | \n22px | \n- | \n
--van-popup-close-icon-color | \nvar(--van-gray-5) | \n- | \n
--van-popup-close-icon-margin | \n16px | \n- | \n
--van-popup-close-icon-z-index | \n1 | \n- | \n