index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div :class="'logo-container-' + layout">
  3. <router-link to="/">
  4. <vab-remix-icon v-if="logo" class="logo" :icon-class="logo" />
  5. <span
  6. class="title"
  7. :class="{ 'hidden-xs-only': layout === 'horizontal' }"
  8. :title="title"
  9. >
  10. {{ title }}
  11. </span>
  12. </router-link>
  13. </div>
  14. </template>
  15. <script>
  16. import { mapGetters } from "vuex";
  17. import { logo } from "@/config/settings";
  18. export default {
  19. name: "Logo",
  20. data() {
  21. return {
  22. title: this.$baseTitle,
  23. };
  24. },
  25. computed: {
  26. ...mapGetters({
  27. logo: "settings/logo",
  28. layout: "settings/layout",
  29. }),
  30. },
  31. };
  32. </script>
  33. <style lang="scss" scoped>
  34. @mixin container {
  35. position: relative;
  36. height: $base-top-bar-height;
  37. overflow: hidden;
  38. line-height: $base-top-bar-height;
  39. background: $base-menu-background;
  40. }
  41. @mixin logo {
  42. display: inline-block;
  43. width: 32px;
  44. height: 32px;
  45. margin-right: 5px;
  46. color: $base-title-color;
  47. vertical-align: middle;
  48. }
  49. @mixin title {
  50. display: inline-block;
  51. overflow: hidden;
  52. font-size: 20px;
  53. font-weight: 600;
  54. line-height: 55px;
  55. color: $base-title-color;
  56. text-overflow: ellipsis;
  57. white-space: nowrap;
  58. vertical-align: middle;
  59. }
  60. .logo-container-horizontal {
  61. @include container;
  62. .logo {
  63. @include logo;
  64. }
  65. .title {
  66. @include title;
  67. }
  68. }
  69. .logo-container-vertical {
  70. @include container;
  71. height: $base-logo-height;
  72. line-height: $base-logo-height;
  73. text-align: center;
  74. .logo {
  75. @include logo;
  76. }
  77. .title {
  78. @include title;
  79. max-width: calc(#{$base-left-menu-width} - 60px);
  80. }
  81. }
  82. </style>