slider.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="app-slider">
  3. <div class="app-slider__logo">
  4. <img src="/logo.png" />
  5. <span v-if="!app.isFold || browser.isMini">{{ app.info.name }}</span>
  6. </div>
  7. <div class="app-slider__container">
  8. <b-menu />
  9. </div>
  10. </div>
  11. </template>
  12. <script lang="ts" name="app-slider" setup>
  13. import { useBase } from "/$/base";
  14. import { useBrowser } from "/@/cool";
  15. import BMenu from "./bmenu";
  16. const { browser } = useBrowser();
  17. const { app } = useBase();
  18. </script>
  19. <style lang="scss">
  20. .app-slider {
  21. height: 100%;
  22. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  23. background-color: #2f3447;
  24. &__logo {
  25. display: flex;
  26. align-items: center;
  27. justify-content: center;
  28. height: 80px;
  29. cursor: pointer;
  30. img {
  31. height: 30px;
  32. width: 30px;
  33. }
  34. span {
  35. color: #fff;
  36. font-weight: bold;
  37. font-size: 26px;
  38. margin-left: 10px;
  39. line-height: 1;
  40. white-space: nowrap;
  41. }
  42. }
  43. &__container {
  44. height: calc(100% - 80px);
  45. overflow-y: auto;
  46. &::-webkit-scrollbar {
  47. width: 0;
  48. height: 0;
  49. }
  50. }
  51. &__menu {
  52. &.el-popper {
  53. &.is-light {
  54. border: 0;
  55. }
  56. }
  57. .el-menu {
  58. border-right: 0;
  59. background-color: transparent;
  60. &--popup {
  61. .cl-svg,
  62. span {
  63. color: #000;
  64. }
  65. }
  66. .el-sub-menu__title,
  67. &-item {
  68. &.is-active,
  69. &:hover {
  70. background-color: var(--color-primary) !important;
  71. .cl-svg,
  72. span {
  73. color: #fff;
  74. }
  75. }
  76. }
  77. .el-sub-menu__title,
  78. &-item,
  79. &__title {
  80. color: #eee;
  81. letter-spacing: 0.5px;
  82. height: 50px;
  83. line-height: 50px;
  84. .wrap {
  85. width: 100%;
  86. box-sizing: border-box;
  87. padding: 0 4px;
  88. }
  89. .cl-svg {
  90. font-size: 16px;
  91. }
  92. span {
  93. display: inline-block;
  94. font-size: 12px;
  95. letter-spacing: 1px;
  96. margin-left: 10px;
  97. user-select: none;
  98. }
  99. }
  100. &--collapse {
  101. .wrap {
  102. text-align: center;
  103. }
  104. .el-sub-menu__title {
  105. padding: 0;
  106. }
  107. }
  108. }
  109. }
  110. }
  111. </style>