mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[Improvement] SubmitBar: upgrade style (#1631)
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<div :class="b()">
|
||||
<slot name="top" />
|
||||
<div :class="b('tip')" v-if="tip || $slots.tip">
|
||||
{{ tip }}<slot name="tip" />
|
||||
</div>
|
||||
<div :class="b('bar')">
|
||||
<slot />
|
||||
<div :class="b('price')">
|
||||
<div :class="b('text')">
|
||||
<template v-if="hasPrice">
|
||||
<span>{{ label || $t('label') }}</span>
|
||||
<span :class="b('price-integer')">{{ currency }}{{ priceInterger }}.</span>
|
||||
<span :class="b('price-decimal')">{{ priceDecimal }}</span>
|
||||
<span :class="b('price')">{{ currency }} {{ price | format }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<van-button :type="buttonType" :disabled="disabled" :loading="loading" @click="$emit('submit')">
|
||||
@@ -51,13 +51,12 @@ export default create({
|
||||
computed: {
|
||||
hasPrice() {
|
||||
return typeof this.price === 'number';
|
||||
},
|
||||
priceInterger() {
|
||||
return Math.floor(this.price / 100);
|
||||
},
|
||||
priceDecimal() {
|
||||
const decimal = Math.floor(this.price % 100);
|
||||
return (decimal < 10 ? '0' : '') + decimal;
|
||||
}
|
||||
},
|
||||
|
||||
filters: {
|
||||
format(price) {
|
||||
return (price / 100).toFixed(2);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user