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