fs-divide-list.vue 1012 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="fs-divide-list" :class="{ 'gutter-v': gutter }">
  3. <fs-grid :columnNum="list.length" :padding="false">
  4. <view v-for="(item, index) in list" :key="index" class="fs-divide-list-item">
  5. <fs-grid-item><slot :item="item"></slot></fs-grid-item>
  6. </view>
  7. </fs-grid>
  8. </view>
  9. </template>
  10. <script>
  11. /**
  12. * 分割列表组件
  13. * @description 分割列表组件
  14. * @property {Array} list 分割列表
  15. * @property {Boolean} gutter 下边距
  16. */
  17. export default {
  18. name: 'fs-divide-list'
  19. }
  20. </script>
  21. <script setup>
  22. const props = defineProps({
  23. list: {
  24. type: Array,
  25. default: () => []
  26. },
  27. gutter: Boolean
  28. })
  29. </script>
  30. <style lang="scss" scoped>
  31. .fs-divide-list {
  32. background-color: #fff;
  33. border-radius: var(--radius);
  34. &-item {
  35. position: relative;
  36. padding: 20rpx;
  37. & + & {
  38. &::before {
  39. position: absolute;
  40. left: 0;
  41. top: 50%;
  42. transform: translateY(-50%);
  43. width: 2rpx;
  44. height: 43rpx;
  45. background-color: #d9d9d9;
  46. content: '';
  47. }
  48. }
  49. }
  50. }
  51. </style>