Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | // region Dependency Injection
import {createApp} from 'vue'
import App from './App.vue'
// note axios
import {apiGlobalPlugin} from "@/libs/axios/plugin";
import { i18n, i18nReady } from '@/libs/i18n'
import { withLoading } from '@/libs/loading'
import router from './router'
import vuetify from './libs/vuetify'
import loggerPlugin from '@/libs/logger/plugin'
import {createPinia} from 'pinia'
import {createPersistedState} from 'pinia-plugin-persistedstate'
import {useAuthStore} from '@/stores/auth'
import './style.css'
import './styles/tokens.css'
import './styles/overrides.css'
import './styles/nav-tight.scss'
// endregion Dependency Injection
// region interface
// endregion interface
// region constants
const app = createApp(App)
const pinia = createPinia()
// endregion constants
// region variable
// endregion variable
// region props
// endregion props
// region emits
// endregion emits
// region validator
// endregion validator
// region methods
pinia.use(createPersistedState())
app.use(apiGlobalPlugin)
app.use(router)
app.use(vuetify)
app.use(loggerPlugin)
app.use(pinia)
app.use(i18n)
// endregion methods
// region export
const auth = useAuthStore(pinia)
// await auth.init()
// await i18nReady()
await withLoading(async () => {
// i18n と auth を並列でも直列でもOK。依存が無ければ並列が速い
await Promise.all([
i18nReady(),
auth.init(),
router.isReady(), // ついでにルーター準備も待つとチラつき減
])
}, 'bootstrap', pinia)
app.mount('#app')
// endregion export
|