hookehuyr

入口页面监听标题变化优化

......@@ -10,22 +10,20 @@
<script setup lang="ts">
import { mainStore, useTitle } from '@/utils/generatePackage'
import { storeToRefs } from 'pinia'
import { computed, ref, watch } from 'vue';
import { computed, watchEffect } from 'vue';
import { useRoute } from 'vue-router'
// 会根据配置判断是否显示调试控件
import vConsole from '@/utils/vconsole'
// 使用 include + pinia 状态管理动态缓存页面
const store = mainStore()
const keepPages = computed(() => {
return store.getKeepPages
})
// 设置页面标题
const $route = useRoute();
watch(
() => $route.path,
watchEffect(
() => {
useTitle($route.meta.title)
}
......