1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-30 16:53:59 +02:00
This commit is contained in:
syuilo
2025-08-27 09:46:31 +09:00
parent d2fd7460ed
commit 2e0a34300a
4 changed files with 8 additions and 5 deletions

View File

@@ -30,19 +30,21 @@ const props = defineProps<{
router?: Router;
}>();
const router = props.router ?? inject(DI.router);
const _router = props.router ?? inject(DI.router);
if (router == null) {
if (_router == null) {
throw new Error('no router provided');
}
const router = _router;
const viewId = randomId();
provide(DI.viewId, viewId);
const currentDepth = inject(DI.routerCurrentDepth, 0);
provide(DI.routerCurrentDepth, currentDepth + 1);
const current = router.current!;
const current = router.current;
const currentPageComponent = shallowRef('component' in current.route ? current.route.component : MkLoadingPage);
const currentPageProps = ref(current.props);
let currentRoutePath = current.route.path;