fs-space.vue 655 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <view class="fs-space" :class="{'gutter-v': gutter}" :style="{gap: size}">
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name: "fs-space"
  9. }
  10. </script>
  11. <script setup>
  12. const props = defineProps({
  13. size: {
  14. type: String,
  15. default: '20rpx'
  16. },
  17. direction: {
  18. type: String,
  19. default: 'row',
  20. validator(value) {
  21. return ['row', 'column'].includes(value)
  22. }
  23. },
  24. justify: {
  25. type: String,
  26. default: 'flex-start'
  27. },
  28. gutter: Boolean
  29. })
  30. </script>
  31. <style lang="scss" scoped>
  32. .fs-space{
  33. display: flex;
  34. flex-direction: v-bind(direction);
  35. flex-wrap: wrap;
  36. justify-content: v-bind(justify);
  37. align-items: center;
  38. }
  39. </style>