Load theme as fast as possible

This commit is contained in:
Kasper Seweryn 2022-04-23 09:26:25 +02:00 committed by Georg Krause
parent d641d4985c
commit cb6f77520c
No known key found for this signature in database
GPG Key ID: 2970D504B2183D22
1 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,8 @@ import store from '~/store'
import { sync } from 'vuex-router-sync' import { sync } from 'vuex-router-sync'
import VueCompositionAPI, { createApp } from '@vue/composition-api' import VueCompositionAPI, { createApp } from '@vue/composition-api'
import Vue, { CreateElement } from 'vue' import Vue, { CreateElement } from 'vue'
import useTheme from '~/composables/useTheme'
useTheme()
Vue.config.devtools = true Vue.config.devtools = true
@ -19,16 +21,17 @@ const app = createApp({
components: { components: {
App: () => import('~/App.vue') App: () => import('~/App.vue')
}, },
setup () {
},
data: () => ({ isMounted: false }), data: () => ({ isMounted: false }),
async mounted () { async mounted () {
this.isMounted = true this.isMounted = true
}, },
render (h: CreateElement) { render (h: CreateElement) {
if (this.isMounted) { if (this.isMounted) {
return h('app') // return h('app')
} }
// TODO (wvffle): Import fake app component
return h() return h()
} }
}) })