Commit ba4cceb6 authored by Kasper Seweryn's avatar Kasper Seweryn 🥞 Committed by Kasper Seweryn
Browse files

Fix app rendering

parent 41edd42b
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
</style> </style>
</head> </head>
<body class="theme-light" id="body"> <body id="body">
<div id="fake-app"> <div id="fake-app">
<div id="fake-sidebar"> <div id="fake-sidebar">
<div id="orange-square"></div> <div id="orange-square"></div>
......
...@@ -480,6 +480,7 @@ import Modal from '@/components/semantic/Modal.vue' ...@@ -480,6 +480,7 @@ import Modal from '@/components/semantic/Modal.vue'
import $ from 'jquery' import $ from 'jquery'
import useThemeList from '@/composables/useThemeList' import useThemeList from '@/composables/useThemeList'
import useTheme from '@/composables/useTheme'
export default { export default {
name: 'Sidebar', name: 'Sidebar',
......
import { useColorMode } from '@vueuse/core' import { useColorMode } from '@vueuse/core'
import { watch } from '@vue/composition-api'
const theme = useColorMode() const theme = useColorMode({
selector: 'body',
document.body.classList.add(`theme-${theme.value}`) modes: {
watch(theme, (newValue, oldValue) => { auto: '',
document.body.classList.remove(`theme-${oldValue}`) light: 'theme-light',
document.body.classList.add(`theme-${newValue}`) dark: 'theme-dark'
}
}) })
export default () => theme export default () => theme
...@@ -4,7 +4,9 @@ import VueLazyload from 'vue-lazyload' ...@@ -4,7 +4,9 @@ import VueLazyload from 'vue-lazyload'
import store from '~/store' 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 { CreateElement } from 'vue' import Vue, { CreateElement } from 'vue'
Vue.config.devtools = true
logger.default.info('Loading environment:', import.meta.env.MODE) logger.default.info('Loading environment:', import.meta.env.MODE)
logger.default.debug('Environment variables:', import.meta.env) logger.default.debug('Environment variables:', import.meta.env)
...@@ -14,13 +16,16 @@ sync(store, router) ...@@ -14,13 +16,16 @@ sync(store, router)
const app = createApp({ const app = createApp({
store, store,
router, router,
components: {
App: () => import('~/App.vue')
},
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 import('~/App.vue') return h('app')
} }
// TODO (wvffle): Import fake app component // TODO (wvffle): Import fake app component
......
...@@ -58,7 +58,7 @@ export const install: AppModule = ({ store, app }) => { ...@@ -58,7 +58,7 @@ export const install: AppModule = ({ store, app }) => {
document.documentElement.setAttribute('lang', htmlLocale) document.documentElement.setAttribute('lang', htmlLocale)
if (locale === 'en_US') { if (locale === 'en_US') {
Vue.prototype.$language.current = locale Vue.config.language = locale
store.commit('ui/momentLocale', 'en') store.commit('ui/momentLocale', 'en')
} }
}, { immediate: true }) }, { immediate: true })
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment