StepItem.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="set-2" :class="{ active: active }">
  3. <view class="set-title">
  4. <slot name="header"></slot>
  5. </view>
  6. <view class="set-content" v-if="hideContent">
  7. <slot name="content"></slot>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. name: 'stepItem',
  14. props: {
  15. active: {
  16. type: Boolean,
  17. default: false
  18. },
  19. hideContent: {
  20. type: Boolean,
  21. default: true
  22. }
  23. },
  24. data () {
  25. return {}
  26. }
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .set-2 {
  31. padding-left: 30px;
  32. position: relative;
  33. .set-content {
  34. background-color: rgba(242, 242, 242, 1);
  35. min-height: 100upx;
  36. border-radius: 10upx;
  37. padding: 10px;
  38. }
  39. .set-title {
  40. font-size: 32rpx;
  41. margin-bottom: 10px;
  42. }
  43. & + .set-2 {
  44. margin-top: 20px;
  45. }
  46. &.active {
  47. &::before {
  48. background: #157a2c;
  49. }
  50. }
  51. }
  52. .set-2::after {
  53. content: '';
  54. /* 必须存在如果没有图标就留空 */
  55. top: 10rpx;
  56. /* 定位 距离*/
  57. border-left: #c6c6c6 1px solid;
  58. /* 横线颜色 */
  59. left: 5px;
  60. /* 定位 距离*/
  61. height: calc(100% + 20px);
  62. /* 高度 */
  63. position: absolute;
  64. /* 定位 */
  65. }
  66. .set-2::before {
  67. content: '';
  68. display: block;
  69. width: 10px;
  70. height: 10px;
  71. position: absolute;
  72. left: 0;
  73. top: 10rpx;
  74. background: #fff;
  75. border-radius: 50%;
  76. z-index: 1;
  77. border: 1px solid #157a2c;
  78. }
  79. .set-2:last-child::after {
  80. display: none;
  81. }
  82. </style>