SideMenu.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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: 0px 16px;
  55. line-height: 36px;
  56. display: flex;
  57. justify-content: space-between;
  58. &:hover {
  59. cursor: pointer;
  60. }
  61. }
  62. }
  63. .side-catalog-wrap{
  64. // padding-top: 16px;
  65. width: 220px;
  66. // height: 100%;
  67. margin-bottom: 16px;
  68. box-sizing: border-box;
  69. color: var(--bs-el-title);
  70. background-color: var(--bs-background-2);
  71. .side-catalog-box{
  72. height: calc(100% - 50px);
  73. overflow-y: auto;
  74. .side-catalog-all{
  75. font-weight: bold;
  76. }
  77. .side-catalog-item{
  78. width: 100%;
  79. padding: 0px 16px;
  80. line-height: 36px;
  81. display: flex;
  82. justify-content: space-between;
  83. &:hover{
  84. cursor: pointer;
  85. }
  86. .el-icon-more{
  87. transform: rotate(90deg);
  88. color: var(--bs-el-title);
  89. font-weight: 400;
  90. }
  91. .active-icon-more{
  92. color:var(--bs-el-text);
  93. }
  94. .catalog-name{
  95. overflow:hidden;
  96. white-space: nowrap;
  97. text-overflow: ellipsis;
  98. -o-text-overflow:ellipsis;
  99. }
  100. .page-list-dropdown{
  101. opacity: 0;
  102. }
  103. .dropdown-show{
  104. opacity: 1;
  105. }
  106. }
  107. /*菜单激活时的样式*/
  108. .active-catalog{
  109. background-color: rgba(var(--bs-el-color-primary-active), 0.4);
  110. color: var(--bs-el-text);
  111. &::after{
  112. content: '';
  113. position: absolute;
  114. left: 0;
  115. width: 4px;
  116. height: 36px;
  117. background-color: var(--bs-el-color-primary);
  118. }
  119. }
  120. }
  121. .add-catalog-box{
  122. padding: 10px 0;
  123. box-sizing: border-box;
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. border-radius: 10px;
  128. margin: 0 8px;
  129. &:hover{
  130. background-color: var(--bs-background-1);
  131. cursor: pointer;
  132. color: var(--bs-el-text);;
  133. }
  134. .el-icon-plus{
  135. padding: 0 5px;
  136. }
  137. }
  138. }
  139. .dropdown-menu-box{
  140. left: 50%;
  141. transform: translateX(-40%);
  142. width: 100px!important;
  143. /deep/.el-dropdown-menu__item{
  144. text-align: center;
  145. padding: 5px;
  146. }
  147. /deep/.popper__arrow{
  148. left: 50% !important;
  149. transform: translateX(-50%) !important;
  150. }
  151. }
  152. </style>