Skip to content

Commit

Permalink
fix(devtools): error with renderer when colorMode is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
romhml committed Nov 27, 2024
1 parent a481410 commit 2893ce2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/devtools/runtime/DevtoolsRenderer.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { onUnmounted, onMounted, reactive } from 'vue'
import { pascalCase } from 'scule'
import { defineAsyncComponent, useColorMode, useRoute } from '#imports'
import { defineAsyncComponent, useRoute } from '#imports'
import { useColorMode } from '@vueuse/core'
const route = useRoute()
const component = route.query?.example
Expand All @@ -15,9 +16,9 @@ function onUpdateRenderer(event: Event & { data?: any }) {
state.slots = { ...event.data.slots }
}
const colorMode = useColorMode()
const mode = useColorMode()
function setColorMode(event: Event & { isDark?: boolean }) {
colorMode.preference = event.isDark ? 'dark' : 'light'
mode.value = event.isDark ? 'dark' : 'light'
}
onMounted(() => {
Expand Down

0 comments on commit 2893ce2

Please sign in to comment.