update Steps style
This commit is contained in:
parent
af4dbfc18f
commit
f64de47872
4 changed files with 70 additions and 142 deletions
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<div :class="wrapClasses" :style="styles">
|
||||
<div :class="wrapClasses">
|
||||
<div :class="[prefixCls + '-tail']"><i></i></div>
|
||||
<div :class="[prefixCls + '-head']">
|
||||
<div :class="[prefixCls + '-head-inner']">
|
||||
<span v-if="!icon && currentStatus != 'finish' && currentStatus != 'error'">{{ stepNumber }}</span>
|
||||
<span v-if="!icon && currentStatus !== 'finish' && currentStatus !== 'error'">{{ stepNumber }}</span>
|
||||
<span v-else :class="iconClasses"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue