SourceTabTools.vue 817 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <el-tabs v-model="current_tab">
  3. <el-tab-pane
  4. v-for="(tab, index) in tabData"
  5. :key="tab[0]"
  6. :name="tab[0]"
  7. :label="tab[1]"
  8. >
  9. <source-json v-if="index == 0" />
  10. <source-debug v-if="index == 1" />
  11. <source-list v-if="index == 2" />
  12. <source-help v-if="index == 3" />
  13. </el-tab-pane>
  14. </el-tabs>
  15. </template>
  16. <script setup>
  17. import { useSourceStore } from "@/store";
  18. const store = useSourceStore();
  19. const current_tab = computed({
  20. get: () => store.currentTab,
  21. set: (val) => (store.currentTab = val),
  22. });
  23. const tabData = ref([
  24. ["editTab", "编辑源"],
  25. ["editDebug", "调试源"],
  26. ["editList", "源列表"],
  27. ["editHelp", "帮助信息"],
  28. ]);
  29. </script>
  30. <style lang="scss" scoped>
  31. :deep(.el-tabs__header) {
  32. margin-bottom: 5px;
  33. }
  34. </style>