Browse Source

fix:调试tab选中

master
guoapeng 3 months ago
parent
commit
369576cc76
  1. 9
      src/pages/Index/Index.vue

9
src/pages/Index/Index.vue

@ -53,9 +53,10 @@
<router-link <router-link
v-show="systemStore.isDebug" v-show="systemStore.isDebug"
to="/index/debug" to="/index/debug"
class="nav-tab-debug"
class="nav-tab nav-tab-debug"
:class="{ active: currentRoute.path?.includes('debug') }" :class="{ active: currentRoute.path?.includes('debug') }"
data-tab="调试" data-tab="调试"
ref="debug"
>调试</router-link >调试</router-link
> >
</div> </div>
@ -356,7 +357,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { ref, onMounted, computed, watch, nextTick } from 'vue'
import { ref, onMounted, computed, watch, nextTick, useTemplateRef } from 'vue'
import { ElDialog, ElMessageBox } from 'element-plus' import { ElDialog, ElMessageBox } from 'element-plus'
import { Time, InitWarn, LoadingModal } from './components/Consumables' import { Time, InitWarn, LoadingModal } from './components/Consumables'
import { import {
@ -416,6 +417,9 @@ const router = useRouter()
const currentRoute = computed(() => router.currentRoute.value) const currentRoute = computed(() => router.currentRoute.value)
console.log(currentRoute.value) console.log(currentRoute.value)
const debug = useTemplateRef('debug')
console.log(debug.value)
const logoClickCount = ref(0) const logoClickCount = ref(0)
let clickTimeout: any; let clickTimeout: any;
const handleLogoClick = () => { const handleLogoClick = () => {
@ -436,6 +440,7 @@ const handleLogoClick = () => {
console.log(systemStore.isDebug) console.log(systemStore.isDebug)
logoClickCount.value = 0 // logoClickCount.value = 0 //
router.push('/index/debug') router.push('/index/debug')
debug.value && updateLinePosition(debug.value)
}) })
.catch(() => { .catch(() => {
logoClickCount.value = 0 // logoClickCount.value = 0 //

Loading…
Cancel
Save