steps.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view>
  3. <uni-section title="基本用法" type="line" padding>
  4. <uni-steps :options="list1" :active="active" />
  5. </uni-section>
  6. <uni-section title="自定义图标" type="line" padding>
  7. <uni-steps :options="list1" active-icon="checkbox" :active="active" />
  8. </uni-section>
  9. <uni-section title="自定义图标" type="line" padding>
  10. <uni-steps :options="list1" active-icon="medal" :active="active" />
  11. </uni-section>
  12. <uni-section title="纵向排列" type="line" padding>
  13. <uni-steps :options="list2" active-color="#007AFF" :active="active" direction="column" />
  14. </uni-section>
  15. <button type="primary" size="mini" style="margin: 30px 10px; width: 100px;" @click="change">改变状态</button>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. components: {},
  21. data() {
  22. return {
  23. active: 1,
  24. list1: [{
  25. title: '事件一'
  26. }, {
  27. title: '事件二'
  28. }, {
  29. title: '事件三'
  30. }, {
  31. title: '事件四'
  32. }],
  33. list2: [{
  34. title: '买家下单',
  35. desc: '2018-11-11'
  36. }, {
  37. title: '卖家发货',
  38. desc: '2018-11-12'
  39. }, {
  40. title: '买家签收',
  41. desc: '2018-11-13'
  42. }, {
  43. title: '交易完成',
  44. desc: '2018-11-14'
  45. }]
  46. }
  47. },
  48. methods: {
  49. change() {
  50. if (this.active < this.list1.length - 1) {
  51. this.active += 1
  52. } else {
  53. this.active = 0
  54. }
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. .status-btn {
  61. /* #ifndef APP-NVUE */
  62. display: flex;
  63. /* #endif */
  64. flex-direction: row;
  65. align-items: center;
  66. justify-content: center;
  67. height: 92rpx;
  68. margin: 30rpx;
  69. background-color: #007AFF;
  70. }
  71. .example-body {
  72. /* #ifndef APP-NVUE */
  73. display: block;
  74. /* #endif */
  75. padding: 15px;
  76. flex-direction: row;
  77. }
  78. </style>