<!--
 * @Author: 季万俊
 * @Date: 2025-06-10 14:36:16
 * @Description: 
-->
<template>
  <router-view></router-view>
  <speechControl v-if="showSpeechControl"></speechControl>
</template>

<script setup>
import { onMounted, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import speechControl from "./view/components/speechControl.vue";
const router = useRouter();

const showSpeechControl = ref(true);

// 监听路由变化，切换页面时隐藏语音控制组件
router.afterEach((to) => {
  if (to.path === "/LargeScreen") {
    showSpeechControl.value = true;
  } else {
    showSpeechControl.value = true;
  }
});

</script>
