PlatformData.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div style="width: 100%">
  3. <div>
  4. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  5. <el-tab-pane label="访问次数统计" name="count">
  6. <Table />
  7. </el-tab-pane>
  8. <el-tab-pane label="积分统计" name="score">
  9. <Score />
  10. </el-tab-pane>
  11. </el-tabs>
  12. </div>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. import { ref } from 'vue';
  17. import type { TabsPaneContext } from 'element-plus';
  18. import Table from './Table.vue'
  19. import Score from './Score.vue';
  20. const activeName = ref('count');
  21. export type LabelType = 'count' | 'score';
  22. const currentLabel = ref<LabelType>('count');
  23. const handleClick = (tab: TabsPaneContext) => {
  24. console.log(tab.paneName);
  25. if (tab.paneName === 'count') {
  26. currentLabel.value = 'count';
  27. } else {
  28. currentLabel.value = 'score';
  29. }
  30. };
  31. </script>
  32. <style>
  33. .demo-tabs>.el-tabs__content {
  34. padding: 32px;
  35. color: #6b778c;
  36. font-size: 32px;
  37. font-weight: 600;
  38. }
  39. .el-tabs__item:hover {
  40. /* color: rgb(53, 120, 220); */
  41. background-color: rgb(53, 120, 220);
  42. }
  43. .el-tabs__item.is-active {
  44. /* color: rgb(221, 239, 255); */
  45. background-color: rgb(221, 239, 255);
  46. border: 3px solid #4693f1 !important
  47. }
  48. </style>