<!--
 * @Author: 王大坤 160484192@qq.com
 * @Date: 2023-04-27 11:53:56
 * @LastEditors: 王大坤 160484192@qq.com
 * @LastEditTime: 2023-11-22 11:14:13
 * @FilePath: /seoadmin/src/layout/components/Sidebar/Logo.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="sidebar-logo-container" :class="{'collapse':collapse}">
    <transition name="sidebarLogoFade">
      <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
        <div class="logoBox">
<!--            <img v-if="logo" :src="logo" class="sidebar-logo">-->
            <h1 class="sidebar-title">{{ title }} </h1>
        </div>
      </router-link>
      <router-link v-else key="expand" class="sidebar-logo-link" to="/">
        <div  class="logoBox">
<!--            <img v-if="logo" :src="logo" class="sidebar-logo">-->
            <h1 class="sidebar-title">{{ title }} </h1>
        </div>

      </router-link>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'SidebarLogo',
  props: {
    collapse: {
      type: Boolean,
      required: true
    }
  },
  data() {
    return {
      title: '凡云ai后台管理系统',
      logo: require("../../../../static/logo.png")
    }
  }
}
</script>

<style lang="scss" scoped>
.sidebarLogoFade-enter-active {
  transition: opacity 1.5s;
}

.sidebarLogoFade-enter,
.sidebarLogoFade-leave-to {
  opacity: 0;
}

.sidebar-logo-container {
  position: relative;
  width: 100%;
  height: 83px;
  line-height: 50px;
  padding: 20px 0;
  background: #2b2f3a;
  text-align: center;
  overflow: hidden;

  & .sidebar-logo-link {
    height: 100%;
    width: 100%;

    & .sidebar-logo {

    }

    & .sidebar-title {
      display: inline-block;
      margin: 0;
      color: #fff;
      font-weight: 600;
      line-height: 50px;
      font-size: 14px;
      font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
      vertical-align: middle;
    }
  }

  &.collapse {
    .sidebar-logo {
      margin-right: 0px;
    }
  }
}
.logoBox{
    width: 100%;
    display: flex;
    justify-content: center;
    align-content: space-around;
    flex-wrap: wrap;
}
.logoBox img{
    width: 50%;
    display: block;
}
.logoBox h1{
    width: 100%;
}
</style>
