logo.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. {{website.logo}}
  8. </span>
  9. </transition>
  10. <transition-group name="fade">
  11. <template v-if="!keyCollapse">
  12. <span class="avue-logo_title"
  13. key="1">{{website.indexTitle}} </span>
  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. },
  25. created() {},
  26. computed: {
  27. ...mapGetters(["website", "keyCollapse"])
  28. },
  29. methods: {}
  30. };
  31. </script>
  32. <style lang="scss">
  33. .fade-leave-active {
  34. transition: opacity 0.2s;
  35. }
  36. .fade-enter-active {
  37. transition: opacity 2.5s;
  38. }
  39. .fade-enter,
  40. .fade-leave-to {
  41. opacity: 0;
  42. }
  43. .avue-logo {
  44. position: fixed;
  45. top: 0;
  46. left: 0;
  47. width: 180px;
  48. height: 40px;
  49. line-height: 40px;
  50. background-color: #20222a;
  51. font-size: 20px;
  52. overflow: hidden;
  53. box-sizing: border-box;
  54. box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  55. color: rgba(255, 255, 255, 0.8);
  56. z-index: 1024;
  57. &_title {
  58. display: block;
  59. text-align: center;
  60. font-weight: 300;
  61. font-size: 20px;
  62. }
  63. &_subtitle {
  64. display: block;
  65. text-align: center;
  66. font-size: 18px;
  67. font-weight: bold;
  68. color: #fff;
  69. }
  70. }
  71. </style>