<template>
  <div class="logo">
    <router-link :to="{name:'dashboard'}">
      <img v-if="showTitle" src="~@/assets/logo2.png" alt="logo">
      <img src="~@/assets/logo.png" alt="logo" v-else>
<!--      <h1 v-if="showTitle">{{ title }}</h1>-->
    </router-link>
  </div>
</template>

<script>
  import { mixin } from '@/utils/mixin.js'

  export default {
    name: 'Logo',
    mixins: [mixin],
    props: {
      title: {
        type: String,
        default: '开心灵工',
        required: false
      },
      showTitle: {
        type: Boolean,
        default: true,
        required: false
      }
    }
  }
</script>
<style lang="scss" scoped>
  /*缩小首页布 局顶部的高度*/
  $height: 65px;

  .sider {
    box-shadow: none !important;
    .logo {
      height: $height !important;
      line-height: $height !important;
      box-shadow: none !important;
      transition: background 300ms;
      background: linear-gradient(45deg, #1890FF 0%, #096DD9 100%);
      padding-left: 0!important;
      display: flex;
      align-items: center;
      justify-content: center;
      a {
        color: white;
        &:hover {
          color: rgba(255, 255, 255, 0.8);
        }
      }
    }

    &.light .logo {
      background-color: #1890ff;
    }
  }
</style>