update Steps style
This commit is contained in:
parent
af4dbfc18f
commit
f64de47872
4 changed files with 70 additions and 142 deletions
|
@ -1,130 +1,55 @@
|
|||
<template>
|
||||
<div>
|
||||
<Steps :current="index">
|
||||
<!--<Step title="开始"></Step>-->
|
||||
<Step v-for="(item, index) in activitiList" :title="item.approveUserName" :key="index" :content="item.startTime"></Step>
|
||||
<!--<Step title="结束"></Step>-->
|
||||
</Steps>
|
||||
<Button @click="change">change</Button>
|
||||
<br><br><br><br>
|
||||
<hr>
|
||||
<!--<Steps :current="1" size="small">-->
|
||||
<!--<Step title="已完成" content="这里是该步骤的描述信息这里是该步骤的描述信息这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="进行中" content="这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="待进行" content="这里是该步骤的描述信息这里是该步骤的描述信息这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="待进行" content="这里是该步骤的描述信息"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<br>-->
|
||||
<!--<Steps :current="2">-->
|
||||
<!--<Step title="已完成"></Step>-->
|
||||
<!--<Step title="进行中"></Step>-->
|
||||
<!--<Step title="待进行"></Step>-->
|
||||
<!--<Step title="待进行"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<br>-->
|
||||
<!--<Steps :current="1" size="small">-->
|
||||
<!--<Step title="已完成"></Step>-->
|
||||
<!--<Step title="进行中"></Step>-->
|
||||
<!--<Step title="待进行"></Step>-->
|
||||
<!--<Step title="待进行"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<br>-->
|
||||
<!--<Steps :current="1" direction="vertical" size="small">-->
|
||||
<!--<Step title="注册" icon="person-add"></Step>-->
|
||||
<!--<Step title="上传头像" icon="camera" content="这里是该步骤的描述信息这里是该步骤的描述信息这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="验证邮箱" icon="email"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<Steps :current="1" direction="vertical">-->
|
||||
<!--<Step title="注册" icon="person-add"></Step>-->
|
||||
<!--<Step title="上传头像" icon="camera" content="这里是该步骤的描述信息这里是该步骤的描述信息这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="验证邮箱" icon="email"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<Steps :current="-1" direction="vertical">-->
|
||||
<!--<Step title="注册" icon="person-add"></Step>-->
|
||||
<!--<Step title="上传头像" icon="camera" content="这里是该步骤的描述信息这里是该步骤的描述信息这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="验证邮箱" status="finish" icon="email"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<br>-->
|
||||
<!--<p>当前正在进行第 {{ current + 1 }} 步</p>-->
|
||||
<!--<Steps :current="current">-->
|
||||
<!--<Step title="步骤1"></Step>-->
|
||||
<!--<Step title="步骤2"></Step>-->
|
||||
<!--<Step title="步骤3"></Step>-->
|
||||
<!--<Step title="步骤4"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<br>-->
|
||||
<!--<i-button type="primary" @click.native="next">下一步</i-button>-->
|
||||
<!--<br><br><br>-->
|
||||
<!--<Steps :current="1" direction="vertical" size="small">-->
|
||||
<!--<Step title="已完成" content="这里是该步骤的描述信息这里是该步骤的描述信息这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="进行中" content="这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="待进行" content="这里是该步骤的描述信息这里是该步骤的描述信息这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="待进行" content="这里是该步骤的描述信息"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<br><br>-->
|
||||
<!--<Steps :current="1" status="error">-->
|
||||
<!--<Step title="已完成" content="这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="进行中" content="这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="待进行" content="这里是该步骤的描述信息"></Step>-->
|
||||
<!--<Step title="待进行" content="这里是该步骤的描述信息"></Step>-->
|
||||
<!--</Steps>-->
|
||||
<!--<Steps direction="vertical" :current="3">-->
|
||||
<!--<Step title="已完成" content="这里是该步骤的描述信息">-->
|
||||
<!--<div style="font-size: 16px; color: green">这里是该步骤的描述信息1</div>-->
|
||||
<!--</Step>-->
|
||||
<!--<Step title="进行中" content="这里是该步骤的描述信息">-->
|
||||
<!--<div style="font-size: 24px; color: red">这里是该步骤的描述信息2</div>-->
|
||||
<!--</Step>-->
|
||||
<!--<Step title="待进行" content="这里是该步骤的描述信息">-->
|
||||
<!--<div style="font-size: 46px; color: blue">这里是该步骤的描述信息3</div>-->
|
||||
<!--</Step>-->
|
||||
<!--<Step title="待进行" content="这里是该步骤的描述信息">-->
|
||||
<!--<div style="font-size: 24px; color: green">这里是该步骤的描述信息4</div>-->
|
||||
<!--</Step>-->
|
||||
<!--</Steps>-->
|
||||
</div>
|
||||
<div style="border: 1px solid #ccc;">
|
||||
<Steps :current="1">
|
||||
<Step title="已完成" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="进行中" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="待进行" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="待进行" content="这里是该步骤的描述信息"></Step>
|
||||
</Steps>
|
||||
<Divider></Divider>
|
||||
<Steps :current="2" size="small">
|
||||
<Step title="已完成"></Step>
|
||||
<Step title="进行中"></Step>
|
||||
<Step title="待进行"></Step>
|
||||
<Step title="待进行"></Step>
|
||||
</Steps>
|
||||
<Divider></Divider>
|
||||
<Steps :current="1">
|
||||
<Step title="注册" icon="ios-person"></Step>
|
||||
<Step title="上传头像" icon="ios-camera"></Step>
|
||||
<Step title="验证邮箱" icon="ios-mail"></Step>
|
||||
</Steps>
|
||||
<Divider></Divider>
|
||||
<p>当前正在进行第 {{ current + 1 }} 步</p>
|
||||
<Steps :current="current">
|
||||
<Step title="步骤1"></Step>
|
||||
<Step title="步骤2"></Step>
|
||||
<Step title="步骤3"></Step>
|
||||
<Step title="步骤4"></Step>
|
||||
</Steps>
|
||||
<Button type="primary" @click="next">Next step</Button>
|
||||
<Divider></Divider>
|
||||
<Steps :current="2" direction="vertical">
|
||||
<Step title="已完成" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="已完成" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="进行中" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="待进行" content="这里是该步骤的描述信息"></Step>
|
||||
</Steps>
|
||||
<Divider></Divider>
|
||||
<Steps :current="1" status="error">
|
||||
<Step title="已完成" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="进行中" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="待进行" content="这里是该步骤的描述信息"></Step>
|
||||
<Step title="待进行" content="这里是该步骤的描述信息"></Step>
|
||||
</Steps>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
total: 512,
|
||||
current: 0,
|
||||
index:0,
|
||||
activitiList:[
|
||||
{
|
||||
approveUserName:'123',
|
||||
startTime:'1'
|
||||
},{
|
||||
approveUserName:'123',
|
||||
startTime:'2'
|
||||
}
|
||||
],
|
||||
changeList:[
|
||||
{
|
||||
approveUserName:'456',
|
||||
startTime:'1'
|
||||
},{
|
||||
approveUserName:'456',
|
||||
startTime:'2'
|
||||
},{
|
||||
approveUserName:'456',
|
||||
startTime:'3'
|
||||
},{
|
||||
approveUserName:'456',
|
||||
startTime:'4'
|
||||
},{
|
||||
approveUserName:'456',
|
||||
startTime:'5'
|
||||
}
|
||||
]
|
||||
current: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
next () {
|
||||
|
@ -133,13 +58,7 @@
|
|||
} else {
|
||||
this.current += 1;
|
||||
}
|
||||
},
|
||||
change () {
|
||||
this.activitiList = this.activitiList.concat(this.changeList);
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// this.change();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue