element/packages/steps/src/steps.vue

45 lines
673 B
Vue
Raw Normal View History

<template>
<div class="el-steps" :class="['is-' + direction]"><slot></slot></div>
</template>
<script>
export default {
name: 'el-steps',
props: {
space: Number,
active: Number,
direction: {
type: String,
default: 'horizontal'
},
finishStatus: {
type: String,
default: 'finish'
},
processStatus: {
type: String,
default: 'process'
}
},
data() {
return {
steps: []
};
},
2016-09-09 04:28:56 +00:00
watch: {
active(newVal, oldVal) {
this.$emit('change', newVal, oldVal);
}
},
mounted() {
this.steps.forEach((child, index) => {
child.index = index;
});
}
};
</script>