mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[new feature] SubmitBar: add tip-icon prop (#1593)
This commit is contained in:
parent
f5093e9a92
commit
71962b2fb1
@ -14,6 +14,7 @@
|
|||||||
price="{{ 3050 }}"
|
price="{{ 3050 }}"
|
||||||
button-text="提交订单"
|
button-text="提交订单"
|
||||||
tip="您的收货地址不支持同城送, 我们已为您推荐快递"
|
tip="您的收货地址不支持同城送, 我们已为您推荐快递"
|
||||||
|
tip-icon="//img.yzcdn.cn/public_files/2017/8/10/6af5b7168eed548100d9041f07b7c616.png"
|
||||||
bind:submit="onClickButton"
|
bind:submit="onClickButton"
|
||||||
custom-class="van-submit-bar"
|
custom-class="van-submit-bar"
|
||||||
safe-area-inset-bottom="{{ false }}"
|
safe-area-inset-bottom="{{ false }}"
|
||||||
|
@ -38,6 +38,7 @@ es5
|
|||||||
price="{{ 3050 }}"
|
price="{{ 3050 }}"
|
||||||
button-text="提交订单"
|
button-text="提交订单"
|
||||||
tip="您的收货地址不支持同城送, 我们已为您推荐快递"
|
tip="您的收货地址不支持同城送, 我们已为您推荐快递"
|
||||||
|
tip-icon="https://img.yzcdn.cn/1.png"
|
||||||
bind:submit="onSubmit"
|
bind:submit="onSubmit"
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
@ -80,6 +81,7 @@ es5
|
|||||||
| button-text | 按钮文字 | `String` | - |
|
| button-text | 按钮文字 | `String` | - |
|
||||||
| button-type | 按钮类型 | `String` | `danger` |
|
| button-type | 按钮类型 | `String` | `danger` |
|
||||||
| tip | 提示文案 | `String` / `Boolean` | - |
|
| tip | 提示文案 | `String` / `Boolean` | - |
|
||||||
|
| tip-icon | 图标名称或图片链接,可选值见 Icon 组件 | `String` | - |
|
||||||
| disabled | 是否禁用按钮 | `Boolean` | `false` |
|
| disabled | 是否禁用按钮 | `Boolean` | `false` |
|
||||||
| loading | 是否显示加载中的按钮 | `Boolean` | `false` |
|
| loading | 是否显示加载中的按钮 | `Boolean` | `false` |
|
||||||
| currency | 货币符号 | `String` | `¥` |
|
| currency | 货币符号 | `String` | `¥` |
|
||||||
|
@ -16,6 +16,18 @@
|
|||||||
background-color: #fff7cc;
|
background-color: #fff7cc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__tip-icon {
|
||||||
|
width:12px;
|
||||||
|
height:12px;
|
||||||
|
margin-right:4px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__tip-text {
|
||||||
|
display: inline;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
&__bar {
|
&__bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -12,6 +12,7 @@ VantComponent({
|
|||||||
|
|
||||||
props: {
|
props: {
|
||||||
tip: null,
|
tip: null,
|
||||||
|
tipIcon: String,
|
||||||
type: Number,
|
type: Number,
|
||||||
price: null,
|
price: null,
|
||||||
label: String,
|
label: String,
|
||||||
|
@ -4,7 +4,16 @@
|
|||||||
<slot name="top" />
|
<slot name="top" />
|
||||||
|
|
||||||
<view wx:if="{{ tip }}" class="van-submit-bar__tip">
|
<view wx:if="{{ tip }}" class="van-submit-bar__tip">
|
||||||
{{ tipStr }}<slot name="tip" />
|
<van-icon
|
||||||
|
wx:if="{{ tipIcon }}"
|
||||||
|
size="12px"
|
||||||
|
name="{{ tipIcon }}"
|
||||||
|
custom-class="van-submit-bar__tip-icon"
|
||||||
|
/>
|
||||||
|
<view wx:if="{{ tipStr }}" class="van-submit-bar__tip-text">
|
||||||
|
{{ tipStr }}
|
||||||
|
</view>
|
||||||
|
<slot name="tip" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="bar-class {{ utils.bem('submit-bar__bar', { safe: safeAreaInsetBottom && isIPhoneX }) }}">
|
<view class="bar-class {{ utils.bem('submit-bar__bar', { safe: safeAreaInsetBottom && isIPhoneX }) }}">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user