fs-cell-group.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="fs-cell-group" :class="{full, radius, 'fs-cell-group-gutter': gutter}" :style="{backgroundColor:bgColor || '#fff'}">
  3. <slot />
  4. </view>
  5. </template>
  6. <script setup>
  7. import { provide, toRefs } from 'vue'
  8. const props = defineProps({
  9. titleWidth: String,
  10. arrow: Boolean,
  11. arrowColor: {
  12. type: String,
  13. default: ''
  14. },
  15. arrowColorType: {
  16. type: String,
  17. validator(value) {
  18. return ['primary', 'success', 'info', 'warning', 'danger'].includes(value)
  19. }
  20. },
  21. border: Boolean,
  22. tighten: Boolean,
  23. gutter: Boolean,
  24. radius: {
  25. type: Boolean,
  26. default: true
  27. },
  28. reverse: Boolean,
  29. align: {
  30. type: String,
  31. default: 'center'
  32. },
  33. justify: {
  34. type: String,
  35. default: 'left',
  36. validator(value) {
  37. return ['left', 'center', 'right'].includes(value)
  38. }
  39. },
  40. bgColor: {
  41. type: String,
  42. },
  43. full: Boolean
  44. })
  45. provide('cellGroup', props)
  46. </script>
  47. <style lang="scss" scoped>
  48. .fs-cell-group{
  49. margin: 0 var(--gutter);
  50. overflow: hidden;
  51. position: relative;
  52. &::after{
  53. position: absolute;
  54. bottom: 0;
  55. left: 0;
  56. height: 2rpx;
  57. width: 100%;
  58. background-color: #fff;
  59. z-index: 10;
  60. content: '';
  61. }
  62. &.full{
  63. margin: 0;
  64. }
  65. &.radius{
  66. border-radius: var(--radius);
  67. }
  68. &-gutter{
  69. margin-bottom: var(--gutter-v);
  70. }
  71. }
  72. </style>