mx-steps.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <uv-steps :current="step" dot>
  3. <uv-steps-item v-for="(s, i) in steps" :title="getTitle(s)" :class="{'step-passed': i<=step}"/>
  4. </uv-steps>
  5. </template>
  6. <script setup>
  7. import {createPropDefine} from "@/utils";
  8. const props = defineProps({
  9. steps: createPropDefine([], Array),
  10. step: createPropDefine(0, Number),
  11. keyName: createPropDefine('')
  12. })
  13. const getTitle = (item) => props.keyName ? item[props.keyName] : item
  14. </script>
  15. <style scoped lang="scss">
  16. ::v-deep(.uv-steps) {
  17. .uv-steps-item__line--row {
  18. top: 12px !important;
  19. }
  20. .uv-steps-item__wrapper--row--dot {
  21. width: 25px !important;
  22. height: 25px !important;
  23. background-color: transparent !important;
  24. .uv-steps-item__wrapper__dot {
  25. width: 15px !important;
  26. height: 15px !important;
  27. }
  28. }
  29. .uv-steps-item__content {
  30. .uv-text__value {
  31. font-size: 14px !important;
  32. }
  33. }
  34. .step-passed {
  35. .uv-steps-item__wrapper__dot {
  36. position: relative;
  37. &::before {
  38. content: ' ';
  39. position: absolute;
  40. background: #FFFFFF;
  41. left: 5px;
  42. top: 5px;
  43. border-radius: 2.5px;
  44. width: 5px;
  45. height: 5px;
  46. }
  47. }
  48. .uv-steps-item__content .uv-text__value {
  49. color: var(--primary-color);
  50. }
  51. }
  52. }
  53. </style>