stepsNav.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="nav_box">
  3. <scroll-view :scroll-x="scrollable" :scroll-left="scrollLeft" scroll-with-animation
  4. class="u-tabs__wrapper__scroll-view" :show-scrollbar="false" ref="u-tabs__wrapper__scroll-view">
  5. <uniSteps :options="stepOptions" :active="activeIndex" @selectStep="selectStep"></uniSteps>
  6. </scroll-view>
  7. </view>
  8. </template>
  9. <script>
  10. import uniSteps from './uni-steps.vue'
  11. export default {
  12. components: {
  13. uniSteps
  14. },
  15. data() {
  16. return {
  17. scrollable: true,
  18. scrollLeft: 10,
  19. activeIndex: 5,
  20. stepOptions: [{
  21. title: '基本信息',
  22. index: 0
  23. },
  24. {
  25. title: '门店信息',
  26. index: 1
  27. },
  28. {
  29. title: '门店图片',
  30. index: 2
  31. },
  32. {
  33. title: '等待审核',
  34. index: 3
  35. },
  36. {
  37. title: '测试',
  38. index: 4
  39. },
  40. {
  41. title: '测试22',
  42. index: 5
  43. },
  44. {
  45. title: '测试444',
  46. index: 6
  47. }
  48. ],
  49. }
  50. },
  51. created() {
  52. this.$nextTick(() => {
  53. // this.scrollLeft = 10
  54. })
  55. },
  56. methods: {
  57. selectStep(item) {
  58. console.log(item);
  59. },
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .nav_box {
  65. width: 100%;
  66. height: 130rpx;
  67. overflow-y: scroll;
  68. }
  69. </style>