SideBar.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <scroll-bar>
  3. <div class="logo">
  4. <img src="https://img.alicdn.com/tfs/TB13UQpnYGYBuNjy0FoXXciBFXa-242-134.png" width="40" />
  5. <span class="site-name">ADMIN LITE</span>
  6. </div>
  7. <el-menu mode="vertical" :show-timeout="200" :router="true" background-color="#00142a" text-color="hsla(0, 0%, 100%, .65)" active-text-color="#409EFF">
  8. <el-menu-item index="/404">404</el-menu-item>
  9. <el-menu-item index="/user">用户管理</el-menu-item>
  10. <el-menu-item index="/views/certificate/index">凭证管理</el-menu-item>
  11. <el-menu-item index="/account/register">账号管理</el-menu-item>
  12. </el-menu>
  13. </scroll-bar>
  14. </template>
  15. <script>
  16. import ScrollBar from './ScrollBar.vue';
  17. export default {
  18. components: { ScrollBar },
  19. name: 'SideBar',
  20. props: {},
  21. data() {
  22. return {};
  23. },
  24. };
  25. </script>
  26. <style lang="scss" scoped>
  27. .logo {
  28. display: flex;
  29. justify-content: center;
  30. align-items: center;
  31. height: 64px;
  32. line-height: 64px;
  33. background: #002140;
  34. color: #fff;
  35. text-align: center;
  36. font-size: 20px;
  37. font-weight: 600;
  38. overflow: hidden;
  39. }
  40. .site-name {
  41. margin-left: 10px;
  42. }
  43. .sidebar-container {
  44. box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
  45. transition: width 0.28s;
  46. width: 256px !important;
  47. height: 100%;
  48. position: fixed;
  49. top: 0;
  50. bottom: 0;
  51. left: 0;
  52. z-index: 1001;
  53. overflow: hidden;
  54. a {
  55. display: inline-block;
  56. width: 100%;
  57. }
  58. .el-menu {
  59. padding-top: 16px;
  60. width: 100% !important;
  61. border: none;
  62. }
  63. .el-submenu .el-menu-item {
  64. min-width: 256px !important;
  65. padding-left: 48px !important;
  66. background-color: #000c17 !important;
  67. &:hover {
  68. color: #fff !important;
  69. }
  70. }
  71. .el-menu-item,
  72. .el-submenu .el-menu-item {
  73. &.is-active {
  74. background-color: #188fff !important;
  75. color: #fff !important;
  76. }
  77. }
  78. .el-submenu__title i {
  79. font-size: 16px;
  80. color: rgba(255, 255, 255, 0.65);
  81. }
  82. }
  83. </style>