<template>
  <div class="divider">
    <div class="title">
      <div class="left">
        <div class="ele-bg-primary box"></div>
        <slot name="title"
          ><span :style="{ 'font-size': size }">{{ title }}</span></slot
        >
        <slot name="action" />
      </div>
      <div class="right">
        <slot />
      </div>
    </div>
    <div class="ele-bg-primary" style="width: 100%; height: 2px"></div>
  </div>
</template>

<script>
  export default {
    props: {
      title: {
        typeof: String,
        default: '信息'
      },
      size: {
        typeof: String,
        default: '20px'
      }
    }
  };
</script>
<style lang="scss" scoped>
  .divider {
    margin-bottom: 20px;

    .title {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      margin-bottom: 10px;
      .left {
        display: flex;
        align-items: center;
      }
      .right {
        margin-right: 20px;
      }
      .box {
        width: 8px;
        height: 20px;
        margin-right: 10px;
      }
      span {
        font-size: 20px;
      }
    }
  }
</style>
