Logo.vue 1.53 KB
<template>
  <div class="functional-logo-container" :class="slideClass">
    <router-link class="sidebar-logo-link" to="/">
      <img v-if="showExpandLogo" :src="expandLogoSrc" class="sidebar-logo-img" alt="logo" />
      <h1 v-if="showExpandTitle" class="sidebar-logo-title" :class="{'is-only': !showExpandLogo}">
        {{ displaySysName }}
      </h1>
    </router-link>
  </div>
</template>

<script>
import sidebarBrandLogoMixin from '@/mixins/sidebar-brand-logo'

export default {
  name: 'SidebarLogo',
  mixins: [sidebarBrandLogoMixin]
}
</script>

<style lang="scss" scoped>
.functional-logo-container {
  width: 210px;
  height: 48px;
  box-sizing: border-box;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;

  .sidebar-logo-link {
    display: flex;
    align-items: center;
    height: 48px;
    width: 100%;
    padding: 0 16px;
    margin: 0;
    overflow: hidden;
    text-decoration: none;
    box-sizing: border-box;
  }

  .sidebar-logo-img {
    height: 28px;
    width: auto;
    max-width: 110px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
  }

  .sidebar-logo-title {
    margin: 0 0 0 8px;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1f2937;

    &.is-only {
      margin-left: 0;
    }
  }

  &.dark {
    background: #161618;

    .sidebar-logo-title {
      color: rgba(255, 255, 255, 0.85);
    }
  }
}
</style>