fs-row.vue 486 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <view class="fs-row" :style="{marginLeft: margin,marginRight:margin}">
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script setup>
  7. import { computed, toRefs, provide } from 'vue'
  8. const props = defineProps({
  9. gutter: {
  10. type: [Number,String],
  11. default: 0
  12. }
  13. })
  14. const margin = computed(() => `${parseInt(props.gutter) / -2}rpx`)
  15. provide('rowGap', props.gutter)
  16. </script>
  17. <style lang="scss" scoped>
  18. .fs-row::after{
  19. content: '';
  20. display: table;
  21. clear: both;
  22. }
  23. </style>