diff --git a/src/plugins/router/index.ts b/src/plugins/router/index.ts index 05176bc..ad2b5e5 100644 --- a/src/plugins/router/index.ts +++ b/src/plugins/router/index.ts @@ -6,21 +6,22 @@ const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes, strict: true, + scrollBehavior: () => ({ left: 0, top: 0 }), }); +if (import.meta.hot) handleHotUpdate(router); +if ($__DEV__) Object.assign(window, { router }); router.onError((error) => { console.debug('🚨 [router error]: ', error); }); -if (import.meta.hot) handleHotUpdate(router); -if ($__DEV__) Object.assign(window, { router }); - function setupRouter(app: import('vue').App) { app - .use(DataLoaderPlugin, { router }) // Register the plugin before the router - .use(router); // adding the router will trigger the initial navigation + // Register the plugin before the router + .use(DataLoaderPlugin, { router }) + // adding the router will trigger the initial navigation + .use(router); } export { router, setupRouter }; - // ======================================================================== // =========================== Router Guards ============================== // ========================================================================