<template>
    <div class="aegle-title" :class="{'aegle-title-round': round,'needly': isNeed}">
      <span class="aegle-title-text" :style="{fontSize: size + 'px',color}"><slot name="title">{{text}}</slot><sup v-if="isNeed" style="color:#E92626">*</sup></span>
      <div class="aegle-title-right"><slot name="default"></slot></div>
    </div>
</template>
<script>
export default {
    name: 'SpTitle',
    props: {
        text: String,
        round: {
            type: Boolean,
            default: false
        },
        size: {
          type: Number,
          default: 16
        },
        color: {
          type: String,
          default: 'rgba(0,0,0,0.90)'
        },
        isNeed: {
          type: Boolean,
          default: false
        }
    },
    data() {
        return {

        }
    }
}
</script>
<style lang="less" scoped>
.aegle-title {
    display: flex;
    position: relative;
    font-size: 16px;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 500;
    text-align: left;
    color: rgba(0,0,0,0.90);
    letter-spacing: 0.24px;
    padding: 0 11px;
    &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 5px;
        display: inline-flex;
        width: 3px;
        height: 12px;
        background: #407df3;
        border-radius: 2px;
    }
    .aegle-title-text {
      display: flex;
    }
    &.needly::before {
      top: 8px;
    }
    &.aegle-title-round {
      padding: 0 14px;
      &::before {
          top: 8px;
          width: 6px;
          height: 6px;
          border-radius: 50%;
      }
      &.needly::before {
        // top: 11px;
      }
    }
    &-right {
      display: flex;
      align-items: center;
      padding-left: 10px;
    }
}
</style>