feiyu02
2025-09-17 b330e57051e54789eb83d10dc58c4d9d10c608e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
  <!-- <el-button type="primary" @click="changeActive">change</el-button> -->
  <!-- <el-row>
    <el-col
      :span="active == 1 ? 16 : 4"
      :class="active == 1 ? 'prod-active' : 'prod-inactive'"
    >step1</el-col>
    <el-col
      :span="active == 2 ? 16 : 4"
      :class="active == 2 ? 'prod-active' : 'prod-inactive'"
    >step2</el-col>
    <el-col
      :span="active == 3 ? 16 : 4"
      :class="active == 3 ? 'prod-active' : 'prod-inactive'"
    >step3</el-col>
  </el-row> -->
  <el-row>
    <div :class="active == 1 ? 'prod-active' : 'prod-inactive'">
        <slot name="step1"></slot>
    </div>
    <div :class="active == 2 ? 'prod-active' : 'prod-inactive'">
        <slot name="step2"></slot>
    </div>
    <div :class="active == 3 ? 'prod-active' : 'prod-inactive'">
        <slot name="step3"></slot>
    </div>
  </el-row>
</template>
<script setup>
import { ref } from 'vue';
 
const props = defineProps({
  active: {
    type: Number,
    default: 1
  }
});
 
// function changeActive() {
//   active.value++;
//   active.value = active.value > 3 ? 1 : active.value;
// }
</script>
<style scoped>
.prod-active {
  width: 66.667%;
  transition: width 0.5s ease;
  background-color: #409eff;
  color: white;
  margin: 5px 0;
  border-radius: 4px;
}
 
.prod-inactive {
  width: 16.667%;
  transition: width 0.5s ease;
  background-color: #e4e7ed;
  color: #606266;
  margin: 5px 0;
  border-radius: 4px;
}
</style>