修复首屏:增加预加载占位并提前恢复主题
This commit is contained in:
1 parent
83b7484558
commit
30cbfd3a9c
7 files changed
+395
-23
No files matched your search
+3
-3
@@ -3,7 +3,7 @@
|
||||
* 全站入口:公共购买页可在未登录时使用独立布局,其余页面沿用路由指定的布局。
|
||||
* 路由放行与组件实际挂载同时受会话约束,防止重定向等待期间仍执行受保护页面请求。
|
||||
*/
|
||||
import { computed, onMounted, onBeforeUnmount } from "vue";
|
||||
import { computed, onBeforeUnmount } from "vue";
|
||||
import { useRouter } from "#app";
|
||||
import { NuxtLayout, NuxtPage, NuxtRouteAnnouncer } from "#components";
|
||||
import BuildUpdateNotice from "~/components/BuildUpdateNotice.vue";
|
||||
@@ -32,8 +32,8 @@ const routeSessionKey = computed(() =>
|
||||
? route.value.path
|
||||
: auth.token || "anonymous",
|
||||
);
|
||||
// 主题监听由入口统一注册和释放,避免每次页面导航重复绑定系统主题事件。
|
||||
onMounted(theme.init);
|
||||
// 在子组件首次渲染前同步主题;入口唯一持有监听,卸载时释放,不随导航重复注册。
|
||||
theme.init();
|
||||
onBeforeUnmount(theme.dispose);
|
||||
</script>
|
||||
|
||||
|
||||
Reference in new issue
Block a user