vben
2020-11-23 ba068ba1df797627e88dcf61af3ea13d0c2929ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
  <div class="app-logo anticon" :class="theme" @click="handleGoHome">
    <img src="/@/assets/images/logo.png" />
    <div class="app-logo__title ml-2 ellipsis">{{ globSetting.title }}</div>
  </div>
</template>
<script lang="ts">
  import type { PropType } from 'vue';
  import { defineComponent } from 'vue';
 
  import { useGlobSetting } from '/@/hooks/setting';
  import { useGo } from '/@/hooks/web/usePage';
 
  import { PageEnum } from '/@/enums/pageEnum';
 
  export default defineComponent({
    name: 'AppLogo',
    props: {
      /**
       * The theme of the current parent component
       */
      theme: {
        type: String as PropType<string>,
      },
    },
    setup() {
      const globSetting = useGlobSetting();
      const go = useGo();
 
      function handleGoHome(): void {
        go(PageEnum.BASE_HOME);
      }
 
      return {
        handleGoHome,
        globSetting,
      };
    },
  });
</script>
<style lang="less" scoped>
  @import (reference) '../../../design/index.less';
 
  .app-logo {
    display: flex;
    align-items: center;
    padding-left: 16px;
    cursor: pointer;
 
    &.light {
      border-bottom: 1px solid @border-color-base;
    }
 
    &.light &__title {
      color: @primary-color;
    }
 
    &.dark &__title {
      color: @white;
    }
 
    &__title {
      font-size: 18px;
      font-weight: 700;
      opacity: 0;
      transition: all 0.5s;
      .respond-to(medium,{
       opacity: 1;
      });
    }
  }
</style>