SideMenu.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div class="side-catalog-wrap">
  3. <el-scrollbar class="side-catalog-box">
  4. <div
  5. v-for="(com,index) in componentList"
  6. :key="index"
  7. class="component-item-box"
  8. :class="{'active-catalog':activeType === com.type}"
  9. @click="componentHandle(com)"
  10. >
  11. {{ com.name }}
  12. </div>
  13. </el-scrollbar>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. components: { },
  19. data () {
  20. return {
  21. componentList: [
  22. {
  23. name: '自定义组件',
  24. type: 'component'
  25. },
  26. {
  27. name: '业务组件',
  28. type: 'bizComponent'
  29. },
  30. {
  31. name: '系统组件',
  32. type: 'system'
  33. }
  34. ],
  35. activeType: 'component'
  36. }
  37. },
  38. mounted () {
  39. },
  40. methods: {
  41. // 点击左侧组件
  42. componentHandle (com) {
  43. this.activeType = com.type
  44. this.$emit('getPageInfo', com.type)
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. @import '~packages/assets/style/bsTheme.scss';
  51. .side-catalog-wrap {
  52. .component-item-box {
  53. width: 100%;
  54. padding: 8px 16px;
  55. display: flex;
  56. justify-content: space-between;
  57. &:hover {
  58. cursor: pointer;
  59. }
  60. }
  61. }
  62. .side-catalog-wrap{
  63. padding-top: 16px;
  64. width: 220px;
  65. height: 100%;
  66. box-sizing: border-box;
  67. color: var(--bs-el-title);
  68. background-color: var(--bs-background-2);
  69. .side-catalog-box{
  70. height: calc(100% - 50px);
  71. overflow-y: auto;
  72. .side-catalog-all{
  73. font-weight: bold;
  74. }
  75. .side-catalog-item{
  76. width: 100%;
  77. padding: 8px 16px;
  78. display: flex;
  79. justify-content: space-between;
  80. &:hover{
  81. cursor: pointer;
  82. }
  83. .el-icon-more{
  84. transform: rotate(90deg);
  85. color: var(--bs-el-title);
  86. font-weight: 400;
  87. }
  88. .active-icon-more{
  89. color:var(--bs-el-text);
  90. }
  91. .catalog-name{
  92. overflow:hidden;
  93. white-space: nowrap;
  94. text-overflow: ellipsis;
  95. -o-text-overflow:ellipsis;
  96. }
  97. .page-list-dropdown{
  98. opacity: 0;
  99. }
  100. .dropdown-show{
  101. opacity: 1;
  102. }
  103. }
  104. /*菜单激活时的样式*/
  105. .active-catalog{
  106. background-image: linear-gradient(to right , var(--bs-el-color-primary), var(--bs-background-2));
  107. background-repeat: round;
  108. color: var(--bs-el-text);
  109. }
  110. }
  111. .add-catalog-box{
  112. padding: 10px 0;
  113. box-sizing: border-box;
  114. display: flex;
  115. justify-content: center;
  116. align-items: center;
  117. border-radius: 10px;
  118. margin: 0 8px;
  119. &:hover{
  120. background-color: var(--bs-background-1);
  121. cursor: pointer;
  122. color: var(--bs-el-text);;
  123. }
  124. .el-icon-plus{
  125. padding: 0 5px;
  126. }
  127. }
  128. }
  129. .dropdown-menu-box{
  130. left: 50%;
  131. transform: translateX(-40%);
  132. width: 100px!important;
  133. /deep/.el-dropdown-menu__item{
  134. text-align: center;
  135. padding: 5px;
  136. }
  137. /deep/.popper__arrow{
  138. left: 50% !important;
  139. transform: translateX(-50%) !important;
  140. }
  141. }
  142. </style>