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

SubmitBar

\n

Intro

\n

Used to display the order amount and submit the order.

\n

Install

\n

Register component globally via app.use, refer to Component Registration for more registration ways.

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

Usage

\n

Basic Usage

\n
<van-submit-bar :price="3050" button-text="Submit" @submit="onSubmit" />\n
\n
import { showToast } from 'vant';\n\nexport default {\n  setup() {\n    const onSubmit = () => showToast('Submit');\n    return {\n      onSubmit,\n    };\n  },\n};\n
\n

Disabled

\n

submit event will not triggered when disabled.

\n
<van-submit-bar\n  disabled\n  :price="3050"\n  button-text="Submit"\n  tip="Some tips"\n  tip-icon="info-o"\n  @submit="onSubmit"\n/>\n
\n

Loading

\n

submit event will not triggered when loading.

\n
<van-submit-bar loading :price="3050" button-text="Submit" @submit="onSubmit" />\n
\n

Advanced Usage

\n

Use slot to add custom contents.

\n
<van-submit-bar :price="3050" button-text="Submit" @submit="onSubmit">\n  <van-checkbox v-model="checked">Check</van-checkbox>\n  <template #tip> Some tips, <span @click="onClickLink">Link</span> </template>\n</van-submit-bar>\n
\n
import { showToast } from 'vant';\n\nexport default {\n  setup() {\n    const onSubmit = () => showToast('Submit');\n    const onClickLink = () => showToast('Click Link');\n    return {\n      onSubmit,\n      onClickLink,\n    };\n  },\n};\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
AttributeDescriptionTypeDefault
pricePricenumber-
decimal-lengthPrice decimal lengthnumber | string2
labelPrice left labelstringTotal:
suffix-labelPrice right labelstring-
text-alignPrice label text align can be set to leftstringright
button-textButton textstring-
button-typeButton typestringdanger
button-colorButton colorstring-
tipTipstring-
tip-iconTip left iconstring-
currencyCurrency symbolstring\xa5
disabledWhether to disable buttonbooleanfalse
loadingWhether to show loading iconbooleanfalse
safe-area-inset-bottomWhether to enable bottom safe area adaptationbooleantrue
placeholderWhether to generate a placeholder elementbooleanfalse
\n

Events

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
EventDescriptionArguments
submitTriggered when click submit button-
\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
NameDescription
defaultCustom left content
buttonCustom button
topCustom top content
tipCustom tips
\n

Types

\n

The component exports the following type definitions:

\n
import type { SubmitBarProps, SubmitBarTextAlign } from 'vant';\n
\n

Theming

\n

CSS Variables

\n

The component provides the following CSS variables, which can be used to customize styles. Please refer to ConfigProvider component.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
NameDefault ValueDescription
--van-submit-bar-height50px-
--van-submit-bar-z-index100-
--van-submit-bar-backgroundvar(--van-background-2)-
--van-submit-bar-button-width110px-
--van-submit-bar-price-colorvar(--van-danger-color)-
--van-submit-bar-price-font-sizevar(--van-font-size-sm)-
--van-submit-bar-price-integer-font-size20px-
--van-submit-bar-price-fontvar(--van-price-font)-
--van-submit-bar-text-colorvar(--van-text-color)-
--van-submit-bar-text-font-sizevar(--van-font-size-md)-
--van-submit-bar-tip-paddingvar(--van-padding-xs) var(--van-padding-sm)-
--van-submit-bar-tip-font-sizevar(--van-font-size-sm)-
--van-submit-bar-tip-line-height1.5-
--van-submit-bar-tip-colorvar(--van-orange-dark)-
--van-submit-bar-tip-backgroundvar(--van-orange-light)-
--van-submit-bar-tip-icon-size12px-
--van-submit-bar-button-height40px-
--van-submit-bar-padding0 var(--van-padding-md)-
\n
'},null,8,d))}}}]);