mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-25 17:30:37 +01:00
fix(devtools): error with renderer when colorMode is disabled (#2792)
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onUnmounted, onMounted, reactive } from 'vue'
|
import { onUnmounted, onMounted, reactive } from 'vue'
|
||||||
import { pascalCase } from 'scule'
|
import { pascalCase } from 'scule'
|
||||||
import { defineAsyncComponent, useColorMode, useRoute } from '#imports'
|
import { defineAsyncComponent, useRoute } from '#imports'
|
||||||
|
import { useColorMode } from '@vueuse/core'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const component = route.query?.example
|
const component = route.query?.example
|
||||||
@@ -15,9 +16,9 @@ function onUpdateRenderer(event: Event & { data?: any }) {
|
|||||||
state.slots = { ...event.data.slots }
|
state.slots = { ...event.data.slots }
|
||||||
}
|
}
|
||||||
|
|
||||||
const colorMode = useColorMode()
|
const mode = useColorMode()
|
||||||
function setColorMode(event: Event & { isDark?: boolean }) {
|
function setColorMode(event: Event & { isDark?: boolean }) {
|
||||||
colorMode.preference = event.isDark ? 'dark' : 'light'
|
mode.value = event.isDark ? 'dark' : 'light'
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user