<template>
  <section class="border2">
    <div class="corner left-bottom"></div>
    <div class="corner right-bottom"></div>
    <div class="bg">
      <div class="header">
        <img  src="https://cdn.cunwuyun.cn/dvcp/dv/img/sanjiaoxing.svg" />
        <h2>{{ title }}</h2>
        <img class="header-right"  src="https://cdn.cunwuyun.cn/dvcp/dv/img/sanjiaoxing.svg" />
      </div>
      <div class="slot">
        <slot/>
      </div>
    </div>
  </section>
</template>

<script>
export default {
  name: 'border2',
  props: {title: String},

  data () {
    return {
    }
  }
}
</script>

<style lang="scss" scoped>
  .border2 {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(7, 29, 62, 0.2) 0%, rgba(15, 69, 124, 0.2) 100%);
    * {
      box-sizing: border-box;
    }

  
    .corner {
      height: 18px;
      width: 18px;
      position: absolute;
      display: block;
      background-image: url(./../asset/corner.svg);
      background-repeat: no-repeat;
    }
    .corner.left-top {
      left: -6px;
      top: -6px;
      transform: rotateY(180deg);
    }
    .corner.right-top {
      right: -6px;
      top: -6px;
    }
    .corner.left-bottom {
      left: -6px;
      bottom: -6px;
      transform: rotateX(180deg) rotateY(180deg);
    }
    .corner.right-bottom {
      right: -6px;
      bottom: -6px;
      transform: rotateX(180deg);
    }
    .bg {
      position: relative;
      height: 100%;
      background-repeat: no-repeat;
      box-sizing: border-box;

      &:after {
        position: absolute;
        bottom: 0;
        left: 0;
        z-index: 1;
        width: 100%;
        height: 28px;
        background-size: 100% 100%;
        content: ' ';
      }

      .header {
        display: flex;
        position: relative;
        align-items: center;
        justify-content: space-between;
        height: 40px;
        line-height: 40px;
        text-align: center;
        background: url(./../asset/border2Title.svg) no-repeat;
        background-size: cover;

        .header-right {
          position: relative;
          transform-origin: center;
          transform: rotate(180deg);
        }

        h2 {
          font-size: 18px;
          color: #fff;
          font-weight: normal;
        }
      }

      .slot {
        height: calc(100% - 40px);
        padding: 0 20px 20px;
      }
    }
  }
</style>
