Here is my code:
<script setup lang="ts">
// import DropDown from "./DropDown.vue";
const colorMode = useColorMode()
function changeColorMode() {
const curColorMode = colorMode.value;
console.log(curColorMode);
if (curColorMode === 'system') colorMode.preference = 'light';
else if (curColorMode === 'light') colorMode.preference = 'dark';
else if (curColorMode === 'dark') colorMode.preference = 'system';
}
</script>
<template>
<button @click="changeColorMode" class="flex justify-center items-center text-gray-700 duration-200 transition-all rounded-lg hover:bg-slate-100 group w-12 h-12 text-4xl ">
<Icon class="group-hover:rotate-12" v-if="$colorMode.value === 'system'" name="tabler:color-swatch"/>
<Icon class="group-hover:rotate-12" v-else-if="$colorMode.value === 'light'" name="material-symbols-light:sunny-rounded"/>
<Icon class="group-hover:rotate-12" v-else-if="$colorMode.value === 'dark'" name="material-symbols-light:dark-mode-rounded"/>
</button>
</template>
The color mode doesn't change at all, it keeps to dark all the time