logo.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div class="avue-logo">
  3. <transition name="fade">
  4. <span v-if="keyCollapse" class="avue-logo_subtitle" key="0">
  5. {{website.logo}}
  6. </span>
  7. </transition>
  8. <transition-group name="fade">
  9. <template v-if="!keyCollapse">
  10. <div key="1" class="avue-logo_title">
  11. <el-image class="myLogo" :src="logoUrl"></el-image>
  12. <span class="myTitle">{{website.indexTitle}} </span>
  13. </div>
  14. </template>
  15. </transition-group>
  16. </div>
  17. </template>
  18. <script>
  19. import { mapGetters } from "vuex";
  20. export default {
  21. name: "logo",
  22. data() {
  23. return {
  24. logoUrl: '/img/logo_pc.png'
  25. };
  26. },
  27. created() { },
  28. computed: {
  29. ...mapGetters(["website", "keyCollapse"])
  30. },
  31. methods: {}
  32. };
  33. </script>
  34. <style lang="scss">
  35. .fade-leave-active {
  36. transition: opacity 0.2s;
  37. }
  38. .fade-enter-active {
  39. transition: opacity 2.5s;
  40. }
  41. .fade-enter,
  42. .fade-leave-to {
  43. opacity: 0;
  44. }
  45. .avue-logo {
  46. position: fixed;
  47. top: 0;
  48. left: 0;
  49. width: 240px;
  50. height: 64px;
  51. line-height: 64px;
  52. background-color: #20222a;
  53. font-size: 20px;
  54. overflow: hidden;
  55. box-sizing: border-box;
  56. box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  57. color: rgba(255, 255, 255, 0.8);
  58. z-index: 1024;
  59. &_subtitle {
  60. display: block;
  61. text-align: center;
  62. font-size: 18px;
  63. font-weight: bold;
  64. color: #fff;
  65. }
  66. &_title {
  67. display: flex;
  68. align-items: center;
  69. justify-content: flex-start;
  70. .myLogo {
  71. margin-left: 5px;
  72. width: 25px;
  73. height: 25px;
  74. }
  75. .myTitle {
  76. margin-left: 5px;
  77. display: block;
  78. text-align: center;
  79. font-weight: 300;
  80. font-size: 20px;
  81. margin-left: 10px;
  82. }
  83. }
  84. }
  85. </style>