<template>
  <!-- 门框组件 -->
  <el-row class="door">
    <el-row class="door-box">
      <div v-if="headShow" class="door-header">
        <div style="display:flex;align-items:center">
          <h3 :style="titleStyle">{{title}}</h3>
        </div>
        <slot name="header">
          <div class="door-h"></div>
        </slot>
      </div>
      <slot name="main"></slot>
      <slot name="bottom"></slot>
    </el-row>
  </el-row>
</template>

<script>
  export default {
    name: 'DoorView',
    props: {
      //头部标题
      title: { type: String, default: '' },
      titleStyle:{type:Object ,default:()=>{}},
      //是否显示头部
      headShow: { type: Boolean, default: true },
    }
  }
</script>

<style lang="scss" scoped>
  .door:nth-child(n + 2) {
    margin-top: 16px;
  }
  .door{
    border-radius: 4px;
    overflow: hidden;
  }
  .door-box {
    width: auto;
    padding: 24px;
    height: 100%;
    background: #fff;


    .door-header {
      display: flex;
      margin-bottom: 26px;
      justify-content: space-between;
      h3 {
        font-size: 20px;
        margin: 0;
      }
    }

    .door-h {
      display: flex;
      flex: 1;
      justify-content: flex-end;
      margin: 0;
    }
  }

</style>
