refactor(frontend): use Symbol for vue provide/inject
This commit is contained in:
parent
9998cb84e8
commit
9e91f85370
10 changed files with 39 additions and 18 deletions
|
|
@ -81,6 +81,7 @@ import { provideMetadataReceiver, provideReactiveMetadata } from '@/page.js';
|
|||
import { i18n } from '@/i18n.js';
|
||||
import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
|
||||
import { mainRouter } from '@/router/main.js';
|
||||
import { DI } from '@/di.js';
|
||||
|
||||
const isRoot = computed(() => mainRouter.currentRoute.value.name === 'index');
|
||||
|
||||
|
|
@ -88,7 +89,7 @@ const DESKTOP_THRESHOLD = 1100;
|
|||
|
||||
const pageMetadata = ref<null | PageMetadata>(null);
|
||||
|
||||
provide('router', mainRouter);
|
||||
provide(DI.router, mainRouter);
|
||||
provideMetadataReceiver((metadataGetter) => {
|
||||
const info = metadataGetter();
|
||||
pageMetadata.value = info;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue