/*! 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:'
\u6309\u94AE\u7528\u4E8E\u89E6\u53D1\u4E00\u4E2A\u64CD\u4F5C\uFF0C\u5982\u63D0\u4EA4\u8868\u5355\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 { Button } from 'vant';\n\nconst app = createApp();\napp.use(Button);\n
\n\u6309\u94AE\u652F\u6301 default
\u3001primary
\u3001success
\u3001warning
\u3001danger
\u4E94\u79CD\u7C7B\u578B\uFF0C\u9ED8\u8BA4\u4E3A default
\u3002
<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\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
<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\u8BBE\u7F6E hairline
\u5C5E\u6027\u53EF\u4EE5\u5C55\u793A 0.5px \u7684\u7EC6\u8FB9\u6846\u3002
<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\u901A\u8FC7 disabled
\u5C5E\u6027\u6765\u7981\u7528\u6309\u94AE\uFF0C\u7981\u7528\u72B6\u6001\u4E0B\u6309\u94AE\u4E0D\u53EF\u70B9\u51FB\u3002
<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\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
<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\u901A\u8FC7 square
\u8BBE\u7F6E\u65B9\u5F62\u6309\u94AE\uFF0C\u901A\u8FC7 round
\u8BBE\u7F6E\u5706\u5F62\u6309\u94AE\u3002
<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\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
<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\u652F\u6301 large
\u3001normal
\u3001small
\u3001mini
\u56DB\u79CD\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3A normal
\u3002
<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\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
<van-button type="primary" block>\u5757\u7EA7\u5143\u7D20</van-button>\n
\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
<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\u901A\u8FC7 color
\u5C5E\u6027\u53EF\u4EE5\u81EA\u5B9A\u4E49\u6309\u94AE\u7684\u989C\u8272\u3002
<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\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\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
type | \n\u7C7B\u578B\uFF0C\u53EF\u9009\u503C\u4E3A primary success warning danger | \nstring | \ndefault | \n
size | \n\u5C3A\u5BF8\uFF0C\u53EF\u9009\u503C\u4E3A large small mini | \nstring | \nnormal | \n
text | \n\u6309\u94AE\u6587\u5B57 | \nstring | \n- | \n
color | \n\u6309\u94AE\u989C\u8272\uFF0C\u652F\u6301\u4F20\u5165 linear-gradient \u6E10\u53D8\u8272 | \nstring | \n- | \n
icon | \n\u5DE6\u4FA7\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 name \u5C5E\u6027 | \nstring | \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
icon-position | \n\u56FE\u6807\u5C55\u793A\u4F4D\u7F6E\uFF0C\u53EF\u9009\u503C\u4E3A right | \nstring | \nleft | \n
tag | \n\u6309\u94AE\u6839\u8282\u70B9\u7684 HTML \u6807\u7B7E | \nstring | \nbutton | \n
native-type | \n\u539F\u751F button \u6807\u7B7E\u7684 type \u5C5E\u6027 | \nstring | \nbutton | \n
block | \n\u662F\u5426\u4E3A\u5757\u7EA7\u5143\u7D20 | \nboolean | \nfalse | \n
plain | \n\u662F\u5426\u4E3A\u6734\u7D20\u6309\u94AE | \nboolean | \nfalse | \n
square | \n\u662F\u5426\u4E3A\u65B9\u5F62\u6309\u94AE | \nboolean | \nfalse | \n
round | \n\u662F\u5426\u4E3A\u5706\u5F62\u6309\u94AE | \nboolean | \nfalse | \n
disabled | \n\u662F\u5426\u7981\u7528\u6309\u94AE | \nboolean | \nfalse | \n
hairline | \n\u662F\u5426\u4F7F\u7528 0.5px \u8FB9\u6846 | \nboolean | \nfalse | \n
loading | \n\u662F\u5426\u663E\u793A\u4E3A\u52A0\u8F7D\u72B6\u6001 | \nboolean | \nfalse | \n
loading-text | \n\u52A0\u8F7D\u72B6\u6001\u63D0\u793A\u6587\u5B57 | \nstring | \n- | \n
loading-type | \n\u52A0\u8F7D\u56FE\u6807\u7C7B\u578B\uFF0C\u53EF\u9009\u503C\u4E3A spinner | \nstring | \ncircular | \n
loading-size | \n\u52A0\u8F7D\u56FE\u6807\u5927\u5C0F\uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3A px | \nnumber | string | \n20px | \n
url | \n\u70B9\u51FB\u540E\u8DF3\u8F6C\u7684\u94FE\u63A5\u5730\u5740 | \nstring | \n- | \n
to | \n\u70B9\u51FB\u540E\u8DF3\u8F6C\u7684\u76EE\u6807\u8DEF\u7531\u5BF9\u8C61\uFF0C\u7B49\u540C\u4E8E Vue Router \u7684 to \u5C5E\u6027 | \nstring | object | \n- | \n
replace | \n\u662F\u5426\u5728\u8DF3\u8F6C\u65F6\u66FF\u6362\u5F53\u524D\u9875\u9762\u5386\u53F2 | \nboolean | \nfalse | \n
\u4E8B\u4EF6\u540D | \n\u8BF4\u660E | \n\u56DE\u8C03\u53C2\u6570 | \n
---|---|---|
click | \n\u70B9\u51FB\u6309\u94AE\uFF0C\u4E14\u6309\u94AE\u72B6\u6001\u4E0D\u4E3A\u52A0\u8F7D\u6216\u7981\u7528\u65F6\u89E6\u53D1 | \nevent: MouseEvent | \n
touchstart | \n\u5F00\u59CB\u89E6\u6478\u6309\u94AE\u65F6\u89E6\u53D1 | \nevent: TouchEvent | \n
\u540D\u79F0 | \n\u8BF4\u660E | \n
---|---|
default | \n\u6309\u94AE\u5185\u5BB9 | \n
icon | \n\u81EA\u5B9A\u4E49\u56FE\u6807 | \n
loading | \n\u81EA\u5B9A\u4E49\u52A0\u8F7D\u56FE\u6807 | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type {\n ButtonType,\n ButtonSize,\n ButtonProps,\n ButtonNativeType,\n ButtonIconPosition,\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-button-mini-height | \n24px | \n- | \n
--van-button-mini-padding | \n0 var(--van-padding-base) | \n- | \n
--van-button-mini-font-size | \nvar(--van-font-size-xs) | \n- | \n
--van-button-small-height | \n32px | \n- | \n
--van-button-small-padding | \n0 var(--van-padding-xs) | \n- | \n
--van-button-small-font-size | \nvar(--van-font-size-sm) | \n- | \n
--van-button-normal-font-size | \nvar(--van-font-size-md) | \n- | \n
--van-button-normal-padding | \n0 15px | \n- | \n
--van-button-large-height | \n50px | \n- | \n
--van-button-default-height | \n44px | \n- | \n
--van-button-default-line-height | \n1.2 | \n- | \n
--van-button-default-font-size | \nvar(--van-font-size-lg) | \n- | \n
--van-button-default-color | \nvar(--van-text-color) | \n- | \n
--van-button-default-background | \nvar(--van-background-2) | \n- | \n
--van-button-default-border-color | \nvar(--van-gray-4) | \n- | \n
--van-button-primary-color | \nvar(--van-white) | \n- | \n
--van-button-primary-background | \nvar(--van-primary-color) | \n- | \n
--van-button-primary-border-color | \nvar(--van-primary-color) | \n- | \n
--van-button-success-color | \nvar(--van-white) | \n- | \n
--van-button-success-background | \nvar(--van-success-color) | \n- | \n
--van-button-success-border-color | \nvar(--van-success-color) | \n- | \n
--van-button-danger-color | \nvar(--van-white) | \n- | \n
--van-button-danger-background | \nvar(--van-danger-color) | \n- | \n
--van-button-danger-border-color | \nvar(--van-danger-color) | \n- | \n
--van-button-warning-color | \nvar(--van-white) | \n- | \n
--van-button-warning-background | \nvar(--van-orange) | \n- | \n
--van-button-warning-border-color | \nvar(--van-orange) | \n- | \n
--van-button-border-width | \nvar(--van-border-width) | \n- | \n
--van-button-radius | \nvar(--van-radius-md) | \n- | \n
--van-button-round-radius | \nvar(--van-radius-max) | \n- | \n
--van-button-plain-background | \nvar(--van-white) | \n- | \n
--van-button-disabled-opacity | \nvar(--van-disabled-opacity) | \n- | \n
--van-button-icon-size | \n1.2em | \n- | \n
--van-button-loading-icon-size | \n20px | \n- | \n