import './assets/main.css'; import 'virtual:uno.css'; import { createApp } from 'vue'; import { createPinia } from 'pinia'; import { createHead } from '@unhead/vue'; import App from './App.vue'; import { router } from './router'; import { DataLoaderPlugin } from 'unplugin-vue-router/data-loaders'; async function init() { if (import.meta.env.MODE === 'development' || 1 === 1) { // TODO: https://github.com/hu3dao/vite-plugin-debug/ // https://eruda.liriliri.io/zh/docs/#快速上手 await import('eruda').then(({ default: eruda }) => { eruda.init({ defaults: { transparency: 0.9, }, }); eruda.show(); }); } createApp(App) .use(createHead()) .use(createPinia()) // Register the plugin before the router .use(DataLoaderPlugin, { router }) // adding the router will trigger the initial navigation .use(router) .mount('#app'); } init();