mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [bugfix] Search box-sizing wrong * [Doc] update vant-demo respo * [Doc] translate theme & demo pages * [Doc] add Internationalization document * [bugfix] remove unnecessary props
42 lines
990 B
Vue
42 lines
990 B
Vue
<template>
|
|
<div class="van-step van-hairline" :class="[`van-step--${$parent.direction}`, { [`van-step--${status}`]: status }]">
|
|
<div class="van-step__circle-container">
|
|
<i class="van-step__circle" v-if="status !== 'process'" />
|
|
<i class="van-icon van-icon-checked" :style="{ color: $parent.activeColor }" v-else />
|
|
</div>
|
|
<div class="van-step__title" :style="titleStyle">
|
|
<slot></slot>
|
|
</div>
|
|
<div class="van-step__line" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'van-step',
|
|
|
|
beforeCreate() {
|
|
this.$parent.steps.push(this);
|
|
},
|
|
|
|
computed: {
|
|
status() {
|
|
const index = this.$parent.steps.indexOf(this);
|
|
const active = this.$parent.active;
|
|
|
|
if (index < active) {
|
|
return 'finish';
|
|
} else if (index === active) {
|
|
return 'process';
|
|
}
|
|
},
|
|
|
|
titleStyle() {
|
|
return this.status === 'process' ? {
|
|
color: this.$parent.activeColor
|
|
} : {};
|
|
}
|
|
}
|
|
};
|
|
</script>
|