Files
WebHooker/app/pages/admin/[...slug].vue
翅膀 de84155e09 perf(console): preserve one instance across admin navigation
Use a fixed page key instead of remounting the whole console for each URL. Refresh each view when shown and isolate overview metrics and logs so page filters cannot leak into the dashboard.
2026-10-17 14:02:39 +08:00

16 lines
474 B
Vue

<script setup lang="ts">
import { parseAdminPath } from "~/utils/admin-path";
definePageMeta({
// One console for every /admin path: switching pages keeps its state (and
// its in-flight saves) instead of mounting a fresh copy per URL.
key: "admin-console",
// Unknown console paths (e.g. /admin/foo, /admin/groups/a/b) 404 before rendering.
validate: (route) => parseAdminPath(route.params.slug) !== null,
});
</script>
<template>
<ConsolePage />
</template>