ViewLineGroup.vue 907 Bytes
<!--
 * @Description: 一行两个一组
 * @Author: huyue
 * @Date: 2022-06-23 11:28:03
 * @LastEditors: huyue
 * @LastEditTime: 2022-06-24 14:57:41
-->
<template>
  <div class="line-group">
    <template v-for="(i, index) in items">
      <div class="box" :key="index" :style="[{ height: height }, { 'margin-bottom': hideMargin ? 0 : '1vh' }]">
        <slot :name="i"></slot>
      </div>
    </template>
  </div>
</template>

<script type="text/ecmascript-6">
import datas from '../utils/data'
export default {
  name: 'ViewLineGroup',
  props: {
    height: {
      type: String,
      default: datas.DefaultData.defaultLineHeight + 'vh'
    },
    hideMargin: Boolean
  },
  data() {
    return {
      items: [1, 2]
    }
  },
  mounted() {
  },
  methods: {
  }
}
</script>

<style scoped lang="scss">
.line-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 8px;
}
</style>