Steps: fix progress line for error step

pull/6282/head
wacky6.AriesMBP 2017-07-06 21:45:32 +08:00 committed by 杨奕
parent c928314ac7
commit 2cd3ef4b6f
1 changed files with 6 additions and 2 deletions

View File

@ -80,6 +80,10 @@ export default {
currentStatus() {
return this.status || this.internalStatus;
},
prevStatus() {
const prevStep = this.$parent.steps[this.index - 1];
return prevStep ? prevStep.currentStatus : 'wait';
},
isLast: function() {
const parent = this.$parent;
return parent.steps[parent.steps.length - 1] === this;
@ -114,7 +118,7 @@ export default {
if (val > this.index) {
this.internalStatus = this.$parent.finishStatus;
} else if (val === this.index) {
} else if (val === this.index && this.prevStatus !== 'error') {
this.internalStatus = this.$parent.processStatus;
} else {
this.internalStatus = 'wait';
@ -129,7 +133,7 @@ export default {
style.transitionDelay = 150 * this.index + 'ms';
if (status === this.$parent.processStatus) {
step = 50;
step = this.currentStatus !== 'error' ? 50 : 0;
} else if (status === 'wait') {
step = 0;
style.transitionDelay = (-150 * this.index) + 'ms';