Skip to content

Commit

Permalink
docs(useColorMode): fix demo (#2944)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Skyblue committed Apr 9, 2023
1 parent 0565b1b commit b574c26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/useColorMode/demo.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { useColorMode, useCycleList } from '@vueuse/core'
import { watchEffect } from 'vue-demi'
const mode = useColorMode({
emitAuto: true,
Expand All @@ -10,6 +11,8 @@ const mode = useColorMode({
})
const { state, next } = useCycleList(['dark', 'light', 'cafe', 'contrast', 'auto'], { initialValue: mode })
watchEffect(() => mode.value = state.value as any)
</script>

<template>
Expand Down

0 comments on commit b574c26

Please sign in to comment.