mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-26 00:09:15 +08:00
[bugfix] Progress: text empty (#1411)
This commit is contained in:
parent
3b8e446b50
commit
8942eb56fa
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div :class="b()">
|
||||
<span :class="b('portion', { 'with-pivot': showPivot })" :style="portionStyle">
|
||||
<span v-if="showPivot" ref="pivot" :style="pivotStyle" :class="b('pivot')">{{ pivotText }}</span>
|
||||
<span :class="b('portion', { 'with-pivot': showPivot && text })" :style="portionStyle">
|
||||
<span v-if="showPivot && text" ref="pivot" :style="pivotStyle" :class="b('pivot')">{{ text }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@ -14,6 +14,7 @@ export default create({
|
||||
|
||||
props: {
|
||||
inactive: Boolean,
|
||||
pivotText: String,
|
||||
pivotColor: String,
|
||||
percentage: {
|
||||
type: Number,
|
||||
@ -24,12 +25,6 @@ export default create({
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
pivotText: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.percentage + '%';
|
||||
}
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#38f'
|
||||
@ -48,6 +43,12 @@ export default create({
|
||||
},
|
||||
|
||||
computed: {
|
||||
text() {
|
||||
return this.isDef(this.pivotText)
|
||||
? this.pivotText
|
||||
: this.percentage + '%';
|
||||
},
|
||||
|
||||
currentColor() {
|
||||
return this.inactive ? '#cacaca' : this.color;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user