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

Button \u6309\u94AE

\n

\u4ECB\u7ECD

\n

\u6309\u94AE\u7528\u4E8E\u89E6\u53D1\u4E00\u4E2A\u64CD\u4F5C\uFF0C\u5982\u63D0\u4EA4\u8868\u5355\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 { Button } from 'vant';\n\nconst app = createApp();\napp.use(Button);\n
\n

\u4EE3\u7801\u6F14\u793A

\n

\u6309\u94AE\u7C7B\u578B

\n

\u6309\u94AE\u652F\u6301 default\u3001primary\u3001success\u3001warning\u3001danger \u4E94\u79CD\u7C7B\u578B\uFF0C\u9ED8\u8BA4\u4E3A default\u3002

\n
<van-button type="primary">\u4E3B\u8981\u6309\u94AE</van-button>\n<van-button type="success">\u6210\u529F\u6309\u94AE</van-button>\n<van-button type="default">\u9ED8\u8BA4\u6309\u94AE</van-button>\n<van-button type="danger">\u5371\u9669\u6309\u94AE</van-button>\n<van-button type="warning">\u8B66\u544A\u6309\u94AE</van-button>\n
\n

\u6734\u7D20\u6309\u94AE

\n

\u901A\u8FC7 plain \u5C5E\u6027\u5C06\u6309\u94AE\u8BBE\u7F6E\u4E3A\u6734\u7D20\u6309\u94AE\uFF0C\u6734\u7D20\u6309\u94AE\u7684\u6587\u5B57\u4E3A\u6309\u94AE\u989C\u8272\uFF0C\u80CC\u666F\u4E3A\u767D\u8272\u3002

\n
<van-button plain type="primary">\u6734\u7D20\u6309\u94AE</van-button>\n<van-button plain type="success">\u6734\u7D20\u6309\u94AE</van-button>\n
\n

\u7EC6\u8FB9\u6846

\n

\u8BBE\u7F6E hairline \u5C5E\u6027\u53EF\u4EE5\u5C55\u793A 0.5px \u7684\u7EC6\u8FB9\u6846\u3002

\n
<van-button plain hairline type="primary">\u7EC6\u8FB9\u6846\u6309\u94AE</van-button>\n<van-button plain hairline type="success">\u7EC6\u8FB9\u6846\u6309\u94AE</van-button>\n
\n

\u7981\u7528\u72B6\u6001

\n

\u901A\u8FC7 disabled \u5C5E\u6027\u6765\u7981\u7528\u6309\u94AE\uFF0C\u7981\u7528\u72B6\u6001\u4E0B\u6309\u94AE\u4E0D\u53EF\u70B9\u51FB\u3002

\n
<van-button disabled type="primary">\u7981\u7528\u72B6\u6001</van-button>\n<van-button disabled type="success">\u7981\u7528\u72B6\u6001</van-button>\n
\n

\u52A0\u8F7D\u72B6\u6001

\n

\u901A\u8FC7 loading \u5C5E\u6027\u8BBE\u7F6E\u6309\u94AE\u4E3A\u52A0\u8F7D\u72B6\u6001\uFF0C\u52A0\u8F7D\u72B6\u6001\u4E0B\u9ED8\u8BA4\u4F1A\u9690\u85CF\u6309\u94AE\u6587\u5B57\uFF0C\u53EF\u4EE5\u901A\u8FC7 loading-text \u8BBE\u7F6E\u52A0\u8F7D\u72B6\u6001\u4E0B\u7684\u6587\u5B57\u3002

\n
<van-button loading type="primary" />\n<van-button loading type="primary" loading-type="spinner" />\n<van-button loading type="success" loading-text="\u52A0\u8F7D\u4E2D..." />\n
\n

\u6309\u94AE\u5F62\u72B6

\n

\u901A\u8FC7 square \u8BBE\u7F6E\u65B9\u5F62\u6309\u94AE\uFF0C\u901A\u8FC7 round \u8BBE\u7F6E\u5706\u5F62\u6309\u94AE\u3002

\n
<van-button square type="primary">\u65B9\u5F62\u6309\u94AE</van-button>\n<van-button round type="success">\u5706\u5F62\u6309\u94AE</van-button>\n
\n

\u56FE\u6807\u6309\u94AE

\n

\u901A\u8FC7 icon \u5C5E\u6027\u8BBE\u7F6E\u6309\u94AE\u56FE\u6807\uFF0C\u652F\u6301 Icon \u7EC4\u4EF6\u91CC\u7684\u6240\u6709\u56FE\u6807\uFF0C\u4E5F\u53EF\u4EE5\u4F20\u5165\u56FE\u6807 URL\u3002

\n
<van-button icon="plus" type="primary" />\n<van-button icon="plus" type="primary">\u6309\u94AE</van-button>\n<van-button\n  icon="https://fastly.jsdelivr.net/npm/@vant/assets/user-active.png"\n  type="primary"\n>\n  \u6309\u94AE\n</van-button>\n
\n

\u6309\u94AE\u5C3A\u5BF8

\n

\u652F\u6301 large\u3001normal\u3001small\u3001mini \u56DB\u79CD\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3A normal\u3002

\n
<van-button type="primary" size="large">\u5927\u53F7\u6309\u94AE</van-button>\n<van-button type="primary" size="normal">\u666E\u901A\u6309\u94AE</van-button>\n<van-button type="primary" size="small">\u5C0F\u578B\u6309\u94AE</van-button>\n<van-button type="primary" size="mini">\u8FF7\u4F60\u6309\u94AE</van-button>\n
\n

\u5757\u7EA7\u5143\u7D20

\n

\u6309\u94AE\u5728\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4E3A\u884C\u5185\u5757\u7EA7\u5143\u7D20\uFF0C\u901A\u8FC7 block \u5C5E\u6027\u53EF\u4EE5\u5C06\u6309\u94AE\u7684\u5143\u7D20\u7C7B\u578B\u8BBE\u7F6E\u4E3A\u5757\u7EA7\u5143\u7D20\u3002

\n
<van-button type="primary" block>\u5757\u7EA7\u5143\u7D20</van-button>\n
\n

\u9875\u9762\u5BFC\u822A

\n

\u53EF\u4EE5\u901A\u8FC7 url \u5C5E\u6027\u8FDB\u884C URL \u8DF3\u8F6C\uFF0C\u6216\u901A\u8FC7 to \u5C5E\u6027\u8FDB\u884C\u8DEF\u7531\u8DF3\u8F6C\u3002

\n
<van-button type="primary" url="https://github.com">URL \u8DF3\u8F6C</van-button>\n<van-button type="primary" to="index">\u8DEF\u7531\u8DF3\u8F6C</van-button>\n
\n

\u81EA\u5B9A\u4E49\u989C\u8272

\n

\u901A\u8FC7 color \u5C5E\u6027\u53EF\u4EE5\u81EA\u5B9A\u4E49\u6309\u94AE\u7684\u989C\u8272\u3002

\n
<van-button color="#7232dd">\u5355\u8272\u6309\u94AE</van-button>\n<van-button color="#7232dd" plain>\u5355\u8272\u6309\u94AE</van-button>\n<van-button color="linear-gradient(to right, #ff6034, #ee0a24)">\n  \u6E10\u53D8\u8272\u6309\u94AE\n</van-button>\n
\n

\u52A8\u753B\u6309\u94AE

\n

\u642D\u914D Button \u548C Swipe \u7EC4\u4EF6\uFF0C\u53EF\u4EE5\u5B9E\u73B0\u5782\u76F4\u6EDA\u52A8\u7684\u52A8\u753B\u6309\u94AE\u6548\u679C\u3002

\n
<van-button type="danger" round>\n  <van-swipe\n    vertical\n    class="notice-swipe"\n    :autoplay="2000"\n    :touchable="false"\n    :show-indicators="false"\n  >\n    <van-swipe-item>\u505A\u4EFB\u52A1</van-swipe-item>\n    <van-swipe-item>\u62BD\u5927\u5956</van-swipe-item>\n  </van-swipe>\n</van-button>\n\n<style>\n  .notice-swipe {\n    height: 40px;\n    line-height: 40px;\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\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
type\u7C7B\u578B\uFF0C\u53EF\u9009\u503C\u4E3A primary success warning dangerstringdefault
size\u5C3A\u5BF8\uFF0C\u53EF\u9009\u503C\u4E3A large small ministringnormal
text\u6309\u94AE\u6587\u5B57string-
color\u6309\u94AE\u989C\u8272\uFF0C\u652F\u6301\u4F20\u5165 linear-gradient \u6E10\u53D8\u8272string-
icon\u5DE6\u4FA7\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 name \u5C5E\u6027string-
icon-prefix\u56FE\u6807\u7C7B\u540D\u524D\u7F00\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 class-prefix \u5C5E\u6027stringvan-icon
icon-position\u56FE\u6807\u5C55\u793A\u4F4D\u7F6E\uFF0C\u53EF\u9009\u503C\u4E3A rightstringleft
tag\u6309\u94AE\u6839\u8282\u70B9\u7684 HTML \u6807\u7B7Estringbutton
native-type\u539F\u751F button \u6807\u7B7E\u7684 type \u5C5E\u6027stringbutton
block\u662F\u5426\u4E3A\u5757\u7EA7\u5143\u7D20booleanfalse
plain\u662F\u5426\u4E3A\u6734\u7D20\u6309\u94AEbooleanfalse
square\u662F\u5426\u4E3A\u65B9\u5F62\u6309\u94AEbooleanfalse
round\u662F\u5426\u4E3A\u5706\u5F62\u6309\u94AEbooleanfalse
disabled\u662F\u5426\u7981\u7528\u6309\u94AEbooleanfalse
hairline\u662F\u5426\u4F7F\u7528 0.5px \u8FB9\u6846booleanfalse
loading\u662F\u5426\u663E\u793A\u4E3A\u52A0\u8F7D\u72B6\u6001booleanfalse
loading-text\u52A0\u8F7D\u72B6\u6001\u63D0\u793A\u6587\u5B57string-
loading-type\u52A0\u8F7D\u56FE\u6807\u7C7B\u578B\uFF0C\u53EF\u9009\u503C\u4E3A spinnerstringcircular
loading-size\u52A0\u8F7D\u56FE\u6807\u5927\u5C0F\uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3A pxnumber | string20px
url\u70B9\u51FB\u540E\u8DF3\u8F6C\u7684\u94FE\u63A5\u5730\u5740string-
to\u70B9\u51FB\u540E\u8DF3\u8F6C\u7684\u76EE\u6807\u8DEF\u7531\u5BF9\u8C61\uFF0C\u7B49\u540C\u4E8E Vue Router \u7684 to \u5C5E\u6027string | object-
replace\u662F\u5426\u5728\u8DF3\u8F6C\u65F6\u66FF\u6362\u5F53\u524D\u9875\u9762\u5386\u53F2booleanfalse
\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
click\u70B9\u51FB\u6309\u94AE\uFF0C\u4E14\u6309\u94AE\u72B6\u6001\u4E0D\u4E3A\u52A0\u8F7D\u6216\u7981\u7528\u65F6\u89E6\u53D1event: MouseEvent
touchstart\u5F00\u59CB\u89E6\u6478\u6309\u94AE\u65F6\u89E6\u53D1event: TouchEvent
\n

Slots

\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
default\u6309\u94AE\u5185\u5BB9
icon\u81EA\u5B9A\u4E49\u56FE\u6807
loading\u81EA\u5B9A\u4E49\u52A0\u8F7D\u56FE\u6807
\n

\u7C7B\u578B\u5B9A\u4E49

\n

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

\n
import type {\n  ButtonType,\n  ButtonSize,\n  ButtonProps,\n  ButtonNativeType,\n  ButtonIconPosition,\n} 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\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\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\n\n\n\n\n\n
\u540D\u79F0\u9ED8\u8BA4\u503C\u63CF\u8FF0
--van-button-mini-height24px-
--van-button-mini-padding0 var(--van-padding-base)-
--van-button-mini-font-sizevar(--van-font-size-xs)-
--van-button-small-height32px-
--van-button-small-padding0 var(--van-padding-xs)-
--van-button-small-font-sizevar(--van-font-size-sm)-
--van-button-normal-font-sizevar(--van-font-size-md)-
--van-button-normal-padding0 15px-
--van-button-large-height50px-
--van-button-default-height44px-
--van-button-default-line-height1.2-
--van-button-default-font-sizevar(--van-font-size-lg)-
--van-button-default-colorvar(--van-text-color)-
--van-button-default-backgroundvar(--van-background-2)-
--van-button-default-border-colorvar(--van-gray-4)-
--van-button-primary-colorvar(--van-white)-
--van-button-primary-backgroundvar(--van-primary-color)-
--van-button-primary-border-colorvar(--van-primary-color)-
--van-button-success-colorvar(--van-white)-
--van-button-success-backgroundvar(--van-success-color)-
--van-button-success-border-colorvar(--van-success-color)-
--van-button-danger-colorvar(--van-white)-
--van-button-danger-backgroundvar(--van-danger-color)-
--van-button-danger-border-colorvar(--van-danger-color)-
--van-button-warning-colorvar(--van-white)-
--van-button-warning-backgroundvar(--van-orange)-
--van-button-warning-border-colorvar(--van-orange)-
--van-button-border-widthvar(--van-border-width)-
--van-button-radiusvar(--van-radius-md)-
--van-button-round-radiusvar(--van-radius-max)-
--van-button-plain-backgroundvar(--van-white)-
--van-button-disabled-opacityvar(--van-disabled-opacity)-
--van-button-icon-size1.2em-
--van-button-loading-icon-size20px-
\n
'},null,8,l))}}}]);