FeedStep.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <script setup lang="ts">
  2. const props = withDefaults(defineProps<{
  3. list: Array<{
  4. step: number
  5. title: string
  6. }>
  7. stage: number
  8. }>(), {
  9. stage: -1,
  10. })
  11. </script>
  12. <template>
  13. <view v-for="(item, index) in props.list" :key="index">
  14. <view class="flex">
  15. <view class="flex items-center justify-center text-[white]" :class="props.stage === index ? 'step_select' : props.stage === -1 ? 'step' : 'step step_left' ">
  16. {{ item.step }}
  17. </view>
  18. <view class="ml-1 font-pingfangsc tracking-[0.8px]" :class="props.stage === index ? 'step_title_select' : 'step_title' ">
  19. {{ item.title }}
  20. </view>
  21. </view>
  22. <view v-if="index !== props.list.length - 1" class="w-[1px] h-[13px] bg-[#999] mt-1 mb-1 step_line" :class="props.stage === -1 ? 'step_line' : 'step_line_select' " />
  23. </view>
  24. </template>
  25. <style scoped>
  26. .step{
  27. background: #999999;
  28. width: 21px;
  29. height: 21px;
  30. border-radius: 30px;
  31. }
  32. .step_left{
  33. margin-left: 3px;
  34. }
  35. .step_select{
  36. background: #0052D9;
  37. width: 27px;
  38. height: 27px;
  39. border-radius: 20px;
  40. }
  41. .step_title{
  42. color: #999999;
  43. font-size:16px;
  44. }
  45. .step_title_select{
  46. color: #151515;
  47. font-size: 20px;
  48. }
  49. .step_line{
  50. margin-left: 10px;
  51. }
  52. .step_line_select{
  53. margin-left: 13px;
  54. }
  55. </style>