May 07, 2021 Vant
import Vue from 'vue';
import { SubmitBar } from 'vant';
Vue.use(SubmitBar);
<van-submit-bar
:price="3050"
button-text="提交订单"
@submit="onSubmit"
/>
The submit event is not triggered when disabled
<van-submit-bar
disabled
:price="3050"
button-text="提交订单"
tip="你的收货地址不支持同城送, 我们已为你推荐快递"
tip-icon="info-o"
@submit="onSubmit"
/>
Submit events are not triggered in the load state
<van-submit-bar
loading
:price="3050"
button-text="提交订单"
@submit="onSubmit"
/>
Insert custom content through the slot
<van-submit-bar
:price="3050"
button-text="提交订单"
@submit="onSubmit"
>
<van-checkbox v-model="checked">全选</van-checkbox>
<span slot="tip">
你的收货地址不支持同城送, <span>修改地址</span>
</span>
</van-submit-bar>
Parameters | Description | Type | The default |
---|---|---|---|
price | Price (units) | number | - |
label | The price is on the left side of the paper | string |
合计:
|
suffix-label | The price is on the right side of the paper | string | - |
text-align
v2.3.0
|
Price case alignment direction with an optional value of
left
|
string |
right
|
button-text | Button text | string | - |
button-type | The type of button | string |
danger
|
tip | Tip paper | string | - |
tip-icon | The icon name or picture link on the left | string | - |
currency | Currency symbol | string |
¥
|
decimal-length | The number of digits after the price scale | number | string |
2
|
disabled | Whether to disable the button | boolean |
false
|
loading | Whether to display the buttons in the load | boolean |
false
|
safe-area-inset-bottom | Whether to turn on the bottom safety zone to fit | boolean |
false
|
The name of the event | Description | Callback parameters |
---|---|---|
submit | Button click event callback | - |
Name | Description |
---|---|
default | Customize the contents to the left of the order bar |
top | Customize what's above the order bar |
tip | Additional actions and instructions in the text |