mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 12:12:15 +01:00
fix light/dark theme not currectly initializing on shared report, unify logic
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, watch } from "vue";
|
||||
import { theme } from "@/utils/theme.js";
|
||||
import { onMounted } from "vue";
|
||||
import { useTheme } from "@/utils/theme.js";
|
||||
|
||||
onMounted(async () => {
|
||||
document.documentElement.classList.add(theme.value);
|
||||
watch(theme, (newTheme, oldTheme) => {
|
||||
document.documentElement.classList.remove(oldTheme);
|
||||
document.documentElement.classList.add(newTheme);
|
||||
});
|
||||
useTheme()
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user