Browse Source

fix: router is initialized first

xiaoxian521 3 years ago
parent
commit
67bc933d5c
1 changed files with 3 additions and 7 deletions
  1. 3 7
      src/main.ts

+ 3 - 7
src/main.ts

@@ -37,14 +37,10 @@ app.component("IconifyIconOnline", IconifyIconOnline);
 app.component("FontIcon", FontIcon);
 
 getServerConfig(app).then(async config => {
+  app.use(router);
+  await router.isReady();
   injectResponsiveStorage(app, config);
   setupStore(app);
-  app
-    .use(router)
-    .use(MotionPlugin)
-    .use(useElementPlus)
-    .use(useTable)
-    .use(usI18n);
-  await router.isReady();
+  app.use(MotionPlugin).use(useElementPlus).use(useTable).use(usI18n);
   app.mount("#app");
 });