logo.vue 1.7 KB

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