|
1 | 1 | <template> |
2 | | - <v-card class="pa-5"> |
3 | | - <v-row align="center" @click="set_current_step(step_index)"> |
4 | | - <v-col cols="auto"> |
| 2 | + <v-stepper-content :step="step_index + 1"> |
| 3 | + <v-row |
| 4 | + align="center" |
| 5 | + class="step-container" |
| 6 | + @click="set_current_step(step_index)" |
| 7 | + > |
| 8 | + <v-col cols="auto" class="icon-container"> |
5 | 9 | <v-icon |
6 | 10 | v-if="current_step_index > step_index" |
7 | 11 | icon="mdi-check-circle" |
|
18 | 22 | color="grey" |
19 | 23 | /> |
20 | 24 | </v-col> |
21 | | - <v-col cols="auto"> |
22 | | - <p class="font-weight-bold"> |
| 25 | + <v-col class="title-container"> |
| 26 | + <p class="step-title font-weight-bold"> |
23 | 27 | {{ steps[step_index].step_title }} |
24 | 28 | </p> |
25 | 29 | </v-col> |
26 | 30 | <v-col |
27 | 31 | v-if=" |
28 | 32 | steps[step_index].chips.length && current_step_index >= step_index |
29 | 33 | " |
| 34 | + class="chips-container" |
30 | 35 | > |
31 | 36 | <v-chip |
32 | 37 | v-for="(chip, chip_index) in steps[step_index].chips" |
33 | 38 | :key="chip_index" |
| 39 | + class="step-chip" |
34 | 40 | > |
35 | 41 | {{ chip }} |
36 | 42 | </v-chip> |
37 | 43 | </v-col> |
38 | 44 | </v-row> |
39 | | - <Transition name="slide-fade"> |
40 | | - <v-col v-if="step_index == current_step_index"> |
41 | | - <component |
42 | | - :is="steps[step_index].component.component_name" |
43 | | - v-bind="steps[step_index].component.component_options" |
44 | | - @update_values="update_values_event" |
45 | | - @increment_step="increment_step()" |
46 | | - @decrement_step="decrement_step()" |
47 | | - /> |
48 | | - </v-col> |
49 | | - </Transition> |
50 | | - </v-card> |
| 45 | + <component |
| 46 | + v-if="step_index == current_step_index" |
| 47 | + :key="step_index" |
| 48 | + :is="steps[step_index].component.component_name" |
| 49 | + v-bind="steps[step_index].component.component_options" |
| 50 | + @update_values="update_values_event" |
| 51 | + @increment_step="increment_step" |
| 52 | + @decrement_step="decrement_step" |
| 53 | + /> |
| 54 | + </v-stepper-content> |
51 | 55 | </template> |
52 | 56 |
|
53 | 57 | <script setup> |
54 | 58 | const props = defineProps({ |
55 | 59 | step_index: { type: Number, required: true }, |
56 | 60 | }) |
57 | | - const { step_index } = props |
| 61 | +
|
58 | 62 | const stepper_tree = inject("stepper_tree") |
59 | 63 | const { current_step_index, steps } = toRefs(stepper_tree) |
60 | 64 |
|
|
78 | 82 | </script> |
79 | 83 |
|
80 | 84 | <style scoped> |
81 | | - .slide-fade-enter-active { |
82 | | - transition: all 0.5s ease-out; |
| 85 | + .step-container { |
| 86 | + margin-bottom: 16px; |
| 87 | + padding: 8px; |
| 88 | + } |
| 89 | +
|
| 90 | + .icon-container { |
| 91 | + display: flex; |
| 92 | + justify-content: center; |
| 93 | + align-items: center; |
| 94 | + } |
| 95 | +
|
| 96 | + .title-container { |
| 97 | + margin-left: 8px; |
| 98 | + } |
| 99 | +
|
| 100 | + .step-title { |
| 101 | + margin: 0; |
83 | 102 | } |
84 | 103 |
|
85 | | - .slide-fade-leave-active { |
86 | | - transition: all 0.5s ease-in; |
| 104 | + .chips-container { |
| 105 | + display: flex; |
| 106 | + gap: 4px; |
87 | 107 | } |
88 | 108 |
|
89 | | - .slide-fade-enter-from, |
90 | | - .slide-fade-leave-to { |
91 | | - transform: translateX(50px); |
92 | | - opacity: 0; |
| 109 | + .step-chip { |
| 110 | + background-color: #f5f5f5; |
93 | 111 | } |
94 | 112 | </style> |
0 commit comments