<template>
  <div class="slide-body">
    <div
      class="slide-list"
      v-for="(item, index) in list"
      :key="index"
      :class="{'bg-ye': index === active}"
    >
      <span class="sl" v-if="index === active"></span>
      <div class="slide-list-title">
        <svg-icon :iconClass="item.icon" class="font-size-25"></svg-icon>
        <span class="font-size-14">{{item.title}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'slide-list',
  props: {
    list: {
      type: Array
    },
    active: {
      type: Number,
      default: 0
    }
  }
}
</script>

<style lang="scss" scoped>
.slide-body {
  padding: 20px 0px;
  .bg-ye {
    background: #fff4eeff;
    .slide-list-title {
      font-weight: 600;
      color: #af1b40ff;
    }
  }
  .slide-list {
    cursor: pointer;
    height: 44px;
    line-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-right: 30px;
    .slide-list-title {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      .font-size-25 {
        padding-right: 10px;
      }
      .font-size-14 {
        padding-top: 3px;
      }
    }
    .sl {
      position: absolute;
      left: 0px;
      height: 100%;
      border-top-right-radius: 3px;
      border-bottom-right-radius: 3px;
      width: 3px;
      background: #af1b40ff;
    }
  }
}
</style>
