add Steps UI

add Steps UI
This commit is contained in:
梁灏 2016-09-23 15:22:37 +08:00
parent 93064e3b74
commit 45b672cad9
8 changed files with 442 additions and 11 deletions

View file

@ -1,6 +1,6 @@
<template>
<div :class="wrapClasses">
<div :class="[`${prefixCls}-tail`]"></div>
<div :class="wrapClasses" :style="styles">
<div :class="[`${prefixCls}-tail`]"><i></i></div>
<div :class="[`${prefixCls}-head`]">
<div :class="[`${prefixCls}-head-inner`]">
<span v-if="!icon && status != 'finish' && status != 'error'">{{ stepNumber }}</span>
@ -41,7 +41,8 @@
return {
prefixCls: prefixCls,
stepNumber: '',
nextError: false
nextError: false,
total: 1
}
},
computed: {
@ -75,6 +76,11 @@
[`${iconPrefixCls}-${icon}`]: icon != ''
}
]
},
styles () {
return {
width: `${1/this.total*100}%`
}
}
},
watch: {

View file

@ -50,9 +50,14 @@
},
methods: {
updateChildProps (isInit) {
const total = this.$children.length;
this.$children.forEach((child, index) => {
child.stepNumber = index + 1;
if (this.direction === 'horizontal') {
child.total = total;
}
// status,,
// todo error,current
if (!(isInit && child.status)) {