import { createApp } from 'vue';
import App from './App';
import router, { setupRouter } from './router/index';
import dayjs from 'dayjs';
import { setupNaive } from './plugins';
import { setupStore } from './store';
import 'dayjs/locale/zh-cn';
import './styles/index.less';
import './utils/rem';

async function setupApp() {
  // app loading
  // const appLoading = createApp(AppLoading);
  // appLoading.mount('#appLoading');
  const app = createApp(App);

  setupNaive(app);

  // store plugin: pinia
  setupStore(app);

  setupRouter(app);

  dayjs.locale('zh-ch');

  // app.use(router);

  await router.isReady();

  // mount app
  app.mount('#app');
}

setupApp();
