diff --git a/examples/routers/progress.vue b/examples/routers/progress.vue index 5cbfa8c8..38f21785 100644 --- a/examples/routers/progress.vue +++ b/examples/routers/progress.vue @@ -1,42 +1,12 @@ diff --git a/src/components/circle/circle.vue b/src/components/circle/circle.vue index c5c80c41..52cbe952 100644 --- a/src/components/circle/circle.vue +++ b/src/components/circle/circle.vue @@ -96,13 +96,13 @@ style = { 'stroke-dasharray': `${(this.percent / 100) * (this.len - 75)}px ${this.len}px`, 'stroke-dashoffset': `-${75 / 2}px`, - 'transition': 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s' + 'transition': 'stroke-dashoffset .3s ease 0s, stroke-dasharray .6s ease 0s, stroke .6s, stroke-width .06s ease .6s' }; } else { style = { 'stroke-dasharray': `${this.len}px ${this.len}px`, 'stroke-dashoffset': `${((100 - this.percent) / 100 * this.len)}px`, - 'transition': 'stroke-dashoffset 0.3s ease 0s, stroke 0.3s ease' + 'transition': 'stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease' }; } return style; diff --git a/src/components/progress/progress.vue b/src/components/progress/progress.vue index 956eb44e..d18badcc 100644 --- a/src/components/progress/progress.vue +++ b/src/components/progress/progress.vue @@ -3,6 +3,7 @@
+
@@ -30,6 +31,10 @@ type: Number, default: 0 }, + successPercent: { + type: Number, + default: 0 + }, status: { validator (value) { return oneOf(value, ['normal', 'active', 'wrong', 'success']); @@ -80,6 +85,15 @@ height: `${this.strokeWidth}px` }; }, + successBgStyle () { + return this.vertical ? { + height: `${this.successPercent}%`, + width: `${this.strokeWidth}px` + } : { + width: `${this.successPercent}%`, + height: `${this.strokeWidth}px` + }; + }, wrapClasses () { return [ `${prefixCls}`, @@ -105,6 +119,9 @@ }, bgClasses () { return `${prefixCls}-bg`; + }, + successBgClasses () { + return `${prefixCls}-success-bg`; } }, created () { diff --git a/src/styles/components/progress.less b/src/styles/components/progress.less index d5fee69a..4ed13cde 100644 --- a/src/styles/components/progress.less +++ b/src/styles/components/progress.less @@ -34,6 +34,7 @@ background-color: #f3f3f3; border-radius: 100px; vertical-align: middle; + position: relative; } &-vertical &-inner { height: 100%; @@ -52,10 +53,18 @@ &-bg { border-radius: 100px; - background-color: @info-color; + background-color: @primary-color; transition: all @transition-time linear; position: relative; } + &-success-bg{ + border-radius: 100px; + background-color: @success-color; + transition: all @transition-time linear; + position: absolute; + top: 0; + left: 0; + } &-text { display: inline-block;