2021-05-28 00:32:34 +08:00
|
|
|
import { createApp } from 'vue';
|
2022-08-10 21:31:59 +08:00
|
|
|
import App from './App.vue';
|
2023-02-23 08:22:44 +08:00
|
|
|
import AppLoading from './components/common/app-loading.vue';
|
2022-04-13 23:45:15 +08:00
|
|
|
import { setupDirectives } from './directives';
|
|
|
|
import { setupRouter } from './router';
|
2022-08-10 21:31:59 +08:00
|
|
|
import { setupAssets } from './plugins';
|
|
|
|
import { setupStore } from './store';
|
2022-10-12 01:03:14 +08:00
|
|
|
import { setupI18n } from './locales';
|
2021-11-14 22:16:44 +08:00
|
|
|
|
2021-08-18 12:02:59 +08:00
|
|
|
async function setupApp() {
|
2022-04-27 07:46:27 +08:00
|
|
|
// import assets: js、css
|
|
|
|
setupAssets();
|
2022-01-04 13:53:07 +08:00
|
|
|
|
2022-11-16 23:35:26 +08:00
|
|
|
// app loading
|
|
|
|
const appLoading = createApp(AppLoading);
|
|
|
|
|
|
|
|
appLoading.mount('#appLoading');
|
|
|
|
|
2022-01-04 13:53:07 +08:00
|
|
|
const app = createApp(App);
|
2022-01-18 01:17:09 +08:00
|
|
|
|
2022-04-27 07:46:27 +08:00
|
|
|
// store plugin: pinia
|
2021-08-18 12:02:59 +08:00
|
|
|
setupStore(app);
|
|
|
|
|
2022-04-27 07:46:27 +08:00
|
|
|
// vue custom directives
|
2022-01-22 02:25:59 +08:00
|
|
|
setupDirectives(app);
|
|
|
|
|
2022-04-27 07:46:27 +08:00
|
|
|
// vue router
|
2021-09-09 12:00:18 +08:00
|
|
|
await setupRouter(app);
|
2021-08-18 12:02:59 +08:00
|
|
|
|
2022-10-12 01:03:14 +08:00
|
|
|
setupI18n(app);
|
|
|
|
|
2023-05-31 01:44:18 +08:00
|
|
|
appLoading.unmount();
|
|
|
|
|
2022-04-27 07:46:27 +08:00
|
|
|
// mount app
|
2021-11-19 21:39:29 +08:00
|
|
|
app.mount('#app');
|
2021-08-18 12:02:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
setupApp();
|