mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[new feature] SubmitBar: add decimal-length prop (#1529)
This commit is contained in:
parent
68db37302b
commit
85aa2c6b3b
@ -83,7 +83,8 @@ es5
|
|||||||
| disabled | 是否禁用按钮 | `Boolean` | `false` |
|
| disabled | 是否禁用按钮 | `Boolean` | `false` |
|
||||||
| loading | 是否显示加载中的按钮 | `Boolean` | `false` |
|
| loading | 是否显示加载中的按钮 | `Boolean` | `false` |
|
||||||
| currency | 货币符号 | `String` | `¥` |
|
| currency | 货币符号 | `String` | `¥` |
|
||||||
| safe-area-inset-bottom | 是否为iPhoneX留出底部安全距离 | `Boolean` | `true` |
|
| safe-area-inset-bottom | 是否为 iPhoneX 留出底部安全距离 | `Boolean` | `true` |
|
||||||
|
| decimal-length | 价格小数点后位数 | `Number` | `2` |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -25,6 +25,10 @@ VantComponent({
|
|||||||
buttonType: {
|
buttonType: {
|
||||||
type: String,
|
type: String,
|
||||||
value: 'danger'
|
value: 'danger'
|
||||||
|
},
|
||||||
|
decimalLength: {
|
||||||
|
type: Number,
|
||||||
|
value: 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -34,7 +38,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
priceStr() {
|
priceStr() {
|
||||||
return (this.data.price / 100).toFixed(2);
|
return (this.data.price / 100).toFixed(this.data.decimalLength);
|
||||||
},
|
},
|
||||||
|
|
||||||
tipStr() {
|
tipStr() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user