index.vue 886 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="steps-v">
  3. <u-steps :list="list" :mode="mode" name="title" :current="modelValue" :name="name" @change="onStepChange">
  4. </u-steps>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props: {
  10. modelValue: {
  11. default: 0
  12. },
  13. // 自定义标题key
  14. name: {
  15. type: String,
  16. default: 'title'
  17. },
  18. mode: {
  19. type: String,
  20. default: 'dot'
  21. },
  22. current: {
  23. default: 0
  24. },
  25. list: {
  26. type: Array,
  27. default: () => []
  28. },
  29. },
  30. data() {
  31. return {
  32. stepCurrent: 0
  33. }
  34. },
  35. methods: {
  36. onStepChange(index) {
  37. this.$emit('change', index)
  38. },
  39. }
  40. }
  41. </script>
  42. <style lang="scss">
  43. .steps-v {
  44. background-color: #fff;
  45. padding: 20rpx 0;
  46. width: 100%;
  47. overflow-x: scroll;
  48. .u-steps .u-steps__item {
  49. min-width: unset;
  50. }
  51. .u-steps .u-steps__item .u-steps__item__text--row {
  52. width: 92px;
  53. }
  54. }
  55. </style>