/*! 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:'
Used to display the order amount and submit the order.
\nRegister component globally via app.use
, refer to Component Registration for more registration ways.
import { createApp } from 'vue';\nimport { SubmitBar } from 'vant';\n\nconst app = createApp();\napp.use(SubmitBar);\n
\n<van-submit-bar :price="3050" button-text="Submit" @submit="onSubmit" />\n
\nimport { showToast } from 'vant';\n\nexport default {\n setup() {\n const onSubmit = () => showToast('Submit');\n return {\n onSubmit,\n };\n },\n};\n
\nsubmit
event will not triggered when disabled.
<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
\nsubmit
event will not triggered when loading.
<van-submit-bar loading :price="3050" button-text="Submit" @submit="onSubmit" />\n
\nUse 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
\nimport { 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
\nAttribute | \nDescription | \nType | \nDefault | \n
---|---|---|---|
price | \nPrice | \nnumber | \n- | \n
decimal-length | \nPrice decimal length | \nnumber | string | \n2 | \n
label | \nPrice left label | \nstring | \nTotal: | \n
suffix-label | \nPrice right label | \nstring | \n- | \n
text-align | \nPrice label text align can be set to left | \nstring | \nright | \n
button-text | \nButton text | \nstring | \n- | \n
button-type | \nButton type | \nstring | \ndanger | \n
button-color | \nButton color | \nstring | \n- | \n
tip | \nTip | \nstring | \n- | \n
tip-icon | \nTip left icon | \nstring | \n- | \n
currency | \nCurrency symbol | \nstring | \n\xa5 | \n
disabled | \nWhether to disable button | \nboolean | \nfalse | \n
loading | \nWhether to show loading icon | \nboolean | \nfalse | \n
safe-area-inset-bottom | \nWhether to enable bottom safe area adaptation | \nboolean | \ntrue | \n
placeholder | \nWhether to generate a placeholder element | \nboolean | \nfalse | \n
Event | \nDescription | \nArguments | \n
---|---|---|
submit | \nTriggered when click submit button | \n- | \n
Name | \nDescription | \n
---|---|
default | \nCustom left content | \n
button | \nCustom button | \n
top | \nCustom top content | \n
tip | \nCustom tips | \n
The component exports the following type definitions:
\nimport type { SubmitBarProps, SubmitBarTextAlign } from 'vant';\n
\nThe component provides the following CSS variables, which can be used to customize styles. Please refer to ConfigProvider component.
\nName | \nDefault Value | \nDescription | \n
---|---|---|
--van-submit-bar-height | \n50px | \n- | \n
--van-submit-bar-z-index | \n100 | \n- | \n
--van-submit-bar-background | \nvar(--van-background-2) | \n- | \n
--van-submit-bar-button-width | \n110px | \n- | \n
--van-submit-bar-price-color | \nvar(--van-danger-color) | \n- | \n
--van-submit-bar-price-font-size | \nvar(--van-font-size-sm) | \n- | \n
--van-submit-bar-price-integer-font-size | \n20px | \n- | \n
--van-submit-bar-price-font | \nvar(--van-price-font) | \n- | \n
--van-submit-bar-text-color | \nvar(--van-text-color) | \n- | \n
--van-submit-bar-text-font-size | \nvar(--van-font-size-md) | \n- | \n
--van-submit-bar-tip-padding | \nvar(--van-padding-xs) var(--van-padding-sm) | \n- | \n
--van-submit-bar-tip-font-size | \nvar(--van-font-size-sm) | \n- | \n
--van-submit-bar-tip-line-height | \n1.5 | \n- | \n
--van-submit-bar-tip-color | \nvar(--van-orange-dark) | \n- | \n
--van-submit-bar-tip-background | \nvar(--van-orange-light) | \n- | \n
--van-submit-bar-tip-icon-size | \n12px | \n- | \n
--van-submit-bar-button-height | \n40px | \n- | \n
--van-submit-bar-padding | \n0 var(--van-padding-md) | \n- | \n