- {{ stepNumber }}
+ {{ stepNumber }}
@@ -68,9 +68,9 @@
if (this.icon) {
icon = this.icon;
} else {
- if (this.currentStatus == 'finish') {
+ if (this.currentStatus === 'finish') {
icon = 'ios-checkmark';
- } else if (this.currentStatus == 'error') {
+ } else if (this.currentStatus === 'error') {
icon = 'ios-close';
}
}
@@ -79,20 +79,15 @@
`${prefixCls}-icon`,
`${iconPrefixCls}`,
{
- [`${iconPrefixCls}-${icon}`]: icon != ''
+ [`${iconPrefixCls}-${icon}`]: icon !== ''
}
];
- },
- styles () {
- return {
- width: `${1/this.total*100}%`
- };
}
},
watch: {
status (val) {
this.currentStatus = val;
- if (this.currentStatus == 'error') {
+ if (this.currentStatus === 'error') {
this.$parent.setNextError();
}
}
diff --git a/src/components/steps/steps.vue b/src/components/steps/steps.vue
index 08aa1150..af7aef20 100644
--- a/src/components/steps/steps.vue
+++ b/src/components/steps/steps.vue
@@ -72,8 +72,8 @@
// 如果已存在status,且在初始化时,则略过
// todo 如果当前是error,在current改变时需要处理
if (!(isInit && child.currentStatus)) {
- if (index == this.current) {
- if (this.status != 'error') {
+ if (index === this.current) {
+ if (this.status !== 'error') {
child.currentStatus = 'process';
}
} else if (index < this.current) {
@@ -83,14 +83,14 @@
}
}
- if (child.currentStatus != 'error' && index != 0) {
+ if (child.currentStatus !== 'error' && index !== 0) {
this.$children[index - 1].nextError = false;
}
});
},
setNextError () {
this.$children.forEach((child, index) => {
- if (child.currentStatus == 'error' && index != 0) {
+ if (child.currentStatus === 'error' && index !== 0) {
this.$children[index - 1].nextError = true;
}
});
diff --git a/src/styles/components/steps.less b/src/styles/components/steps.less
index e59e5697..2b334f23 100644
--- a/src/styles/components/steps.less
+++ b/src/styles/components/steps.less
@@ -6,14 +6,26 @@
@steps-title-color: #666;
.@{steps-prefix-cls} {
- font-size: 0;
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
width: 100%;
+ font-size: 0;
line-height: 1.5;
&-item{
display: inline-block;
position: relative;
vertical-align: top;
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+ overflow: hidden;
+ &:last-child{
+ -webkit-box-flex: 0;
+ -ms-flex: 0;
+ flex: none;
+ }
&.@{steps-prefix-cls}-status-wait{
.@{steps-prefix-cls}-head-inner {
@@ -267,8 +279,10 @@
}
.@{steps-prefix-cls}-vertical {
+ display: block;
.@{steps-prefix-cls}-item {
display: block;
+ overflow: visible;
}
.@{steps-prefix-cls}-tail {