index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="useBox">
  3. <!-- table切换 -->
  4. <div
  5. style="
  6. width: 100%;
  7. height: 24px;
  8. background-color: #7084b4;
  9. line-height: 20px;
  10. "
  11. >
  12. <template :key="item" v-for="(item, index) in menuList">
  13. <span
  14. @click="tableChange(item, index)"
  15. :class="['tables', { tableLis: selectedIndex === index }]"
  16. >
  17. {{ item.name }}
  18. <img
  19. v-if="selectedIndex === index ? true : false"
  20. style="position: absolute; top: 4px; right: 4px"
  21. src="../../assets/images/close.png"
  22. @click="shotdown(item)"
  23. />
  24. </span>
  25. </template>
  26. </div>
  27. <!-- 面包屑功能栏 -->
  28. <div class="breadBox">
  29. <!-- 左侧 -->
  30. <div
  31. style="
  32. display: flex;
  33. justify-content: space-around;
  34. align-items: center;
  35. "
  36. >
  37. <!-- 前进后退 -->
  38. <div
  39. style="
  40. display: flex;
  41. justify-content: space-around;
  42. align-items: center;
  43. "
  44. >
  45. <img
  46. style="display: block; width: 11px; height: 11px"
  47. :src="blueLeft"
  48. alt=""
  49. />
  50. <img
  51. style="display: block; width: 16px; height: 16px"
  52. :src="grayRight"
  53. alt=""
  54. />
  55. </div>
  56. <!-- 面包屑 -->
  57. <div>
  58. <el-breadcrumb separator="/">
  59. <el-breadcrumb-item style="font-size: 12px"
  60. >homepage</el-breadcrumb-item
  61. >
  62. <el-breadcrumb-item style="font-size: 12px"
  63. >promotion management</el-breadcrumb-item
  64. >
  65. <el-breadcrumb-item style="font-size: 12px"
  66. >promotion detail</el-breadcrumb-item
  67. >
  68. </el-breadcrumb>
  69. </div>
  70. </div>
  71. <!-- 右侧 -->
  72. <div>
  73. <img :src="sort" alt="" />
  74. <img :src="squre" alt="" />
  75. </div>
  76. </div>
  77. </div>
  78. </template>
  79. <script setup>
  80. import { ref } from "vue";
  81. import blueLeft from "../../assets/images/blueLeft.png";
  82. import grayRight from "../../assets/images/grayRight.png";
  83. let selectedIndex = ref(0);
  84. let menuList = ref([
  85. {
  86. name: "标签1",
  87. choose: "1",
  88. },
  89. {
  90. name: "标签2",
  91. choose: "2",
  92. },
  93. ]);
  94. // tableMenu切换
  95. function tableChange(row, num) {
  96. this.selectedIndex = num;
  97. }
  98. // x图标事件
  99. function shotdown(row) {
  100. this.menuList = this.menuList.filter((item) => item.name !== row.name);
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .useBox {
  105. width: 100%;
  106. }
  107. .tables {
  108. display: inline-block;
  109. width: 112px;
  110. height: 22px;
  111. border-radius: 4px;
  112. line-height: 21px;
  113. text-align: center;
  114. font-size: 12px;
  115. margin-left: 5px;
  116. position: relative;
  117. }
  118. .tableLis {
  119. display: inline-block;
  120. width: 112px;
  121. height: 22px;
  122. border-radius: 4px;
  123. background-color: #ebeff6;
  124. line-height: 21px;
  125. text-align: center;
  126. font-size: 12px;
  127. margin-left: 5px;
  128. position: relative;
  129. }
  130. .manyUse {
  131. width: 100%;
  132. height: 48px;
  133. /* background-color: gray; */
  134. line-height: 48px;
  135. display: flex;
  136. justify-content: flex-start;
  137. align-items: center;
  138. }
  139. .el-dropdown-link {
  140. color: white;
  141. }
  142. .breadBox {
  143. width: 100%;
  144. height: 24px;
  145. display: flex;
  146. justify-content: space-between;
  147. align-items: center;
  148. background-color: #d9e0f0;
  149. }
  150. ::v-deep .el-collapse-item__header {
  151. height: 24px !important;
  152. background-color: #ebeff6 !important;
  153. }
  154. </style>