mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-30 16:53:59 +02:00
refactor
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user