|
@@ -52,10 +52,7 @@ export default {
|
|
|
title: String,
|
|
|
icon: String,
|
|
|
description: String,
|
|
|
- status: {
|
|
|
- type: String,
|
|
|
- default: 'wait'
|
|
|
- }
|
|
|
+ status: String
|
|
|
},
|
|
|
|
|
|
data() {
|
|
@@ -65,7 +62,7 @@ export default {
|
|
|
lineStyle: {},
|
|
|
mainOffset: 0,
|
|
|
isLast: false,
|
|
|
- currentStatus: this.status
|
|
|
+ internalStatus: ''
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -73,19 +70,25 @@ export default {
|
|
|
this.$parent.steps.push(this);
|
|
|
},
|
|
|
|
|
|
+ computed: {
|
|
|
+ currentStatus() {
|
|
|
+ return this.status || this.internalStatus;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
updateStatus(val) {
|
|
|
const prevChild = this.$parent.$children[this.index - 1];
|
|
|
|
|
|
if (val > this.index) {
|
|
|
- this.currentStatus = this.$parent.finishStatus;
|
|
|
+ this.internalStatus = this.$parent.finishStatus;
|
|
|
} else if (val === this.index) {
|
|
|
- this.currentStatus = this.$parent.processStatus;
|
|
|
+ this.internalStatus = this.$parent.processStatus;
|
|
|
} else {
|
|
|
- this.currentStatus = 'wait';
|
|
|
+ this.internalStatus = 'wait';
|
|
|
}
|
|
|
|
|
|
- if (prevChild) prevChild.calcProgress(this.currentStatus);
|
|
|
+ if (prevChild) prevChild.calcProgress(this.internalStatus);
|
|
|
},
|
|
|
|
|
|
calcProgress(status) {
|
|
@@ -100,6 +103,7 @@ export default {
|
|
|
style.transitionDelay = (-150 * this.index) + 'ms';
|
|
|
}
|
|
|
|
|
|
+ style.borderWidth = step ? '1px' : 0;
|
|
|
this.$parent.direction === 'vertical'
|
|
|
? style.height = step + '%'
|
|
|
: style.width = step + '%';
|