index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <headerBar :title="$t('router.developer')" />
  3. <div class="page">
  4. <div class="tabs">
  5. <div class="tab" @click="handleSelect(1)" :class="{active:activeIndex == 1}">{{ $t('developer.tabSetting') }}</div>
  6. <div class="tab" @click="handleSelect(2)" :class="{active:activeIndex == 2}">{{ $t('developer.tabMCU') }}</div>
  7. <div class="tab" @click="handleSelect(3)" :class="{active:activeIndex == 3}">{{ $t('developer.tabRS485') }}</div>
  8. </div>
  9. <normal v-if="activeIndex == 1"/>
  10. <mcu v-if="activeIndex == 2"/>
  11. <cmd v-if="activeIndex == 3"/>
  12. </div>
  13. </template>
  14. <script setup lang="ts">
  15. import { useI18n } from 'vue-i18n'
  16. import headerBar from '@/components/header-bar/index.vue'
  17. import normal from './normal'
  18. import mcu from './mcu'
  19. import cmd from './cmd'
  20. import { ref } from 'vue'
  21. const { t } = useI18n()
  22. const activeIndex = ref('1')
  23. const handleSelect = (key) => {
  24. activeIndex.value = key
  25. }
  26. </script>
  27. <style scoped lang="scss">
  28. .page { min-height: calc(100vh - 30px); }
  29. .tabs { height: 40px; line-height: 40px; position: sticky; top:30px; background: #fff; z-index: 100; }
  30. .tab { height: 38px; line-height: 40px; cursor: pointer; }
  31. </style>