refactor(plugins): 重构插件自动加载逻辑
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import './styles/index.ts';
|
||||
|
||||
import { LogLevels } from 'consola';
|
||||
import App from './App.vue';
|
||||
import { setupPlugins } from './plugins';
|
||||
@@ -6,11 +7,8 @@ import { router } from './plugins/00.router-plugin.ts';
|
||||
|
||||
consola.level = LogLevels.verbose;
|
||||
|
||||
const autoInstallModules = import.meta.glob('./plugins/!(index).ts', {
|
||||
eager: true /* true 为同步,false 为异步 */,
|
||||
});
|
||||
|
||||
const app = setupPlugins(createApp(App), autoInstallModules);
|
||||
const app = createApp(App);
|
||||
setupPlugins(app);
|
||||
await router.isReady();
|
||||
await new Promise((resolve) => setTimeout(resolve, 280));
|
||||
app.mount('#app');
|
||||
|
||||
Reference in New Issue
Block a user