Skip to content

Commit

Permalink
fix(devtools): error with renderer when colorMode is disabled (#2792)
Browse files Browse the repository at this point in the history
  • Loading branch information
romhml authored Nov 28, 2024
1 parent ecc4755 commit f06fbaf
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 f06fbaf

Please sign in to comment.