12345678910111213141516171819202122232425262728293031323334353637 |
- <template>
- <view class="fs-row" :style="{ marginLeft: margin, marginRight: margin }"><slot></slot></view>
- </template>
- <script>
- /**
- * 栅格布局组件
- * @description 栅格布局组件
- * @property {Number,String} gutter 间距(单位rpx)
- */
- export default {
- name: 'fs-row'
- }
- </script>
- <script setup>
- import { computed, toRefs, provide } from 'vue'
- const props = defineProps({
- gutter: {
- type: [Number, String],
- default: 0
- }
- })
- const margin = computed(() => `${parseInt(props.gutter) / -2}rpx`)
- provide('rowGap', props.gutter)
- </script>
- <style lang="scss" scoped>
- .fs-row::after {
- content: '';
- display: table;
- clear: both;
- }
- </style>
|