feat: daisyui theme toggle
This commit is contained in:
parent
b6a4b9e362
commit
dbddd6beb6
@ -29,10 +29,12 @@ const changeMode = (val: 'dark' | 'light' | 'system') => {
|
||||
if (value === 'dark') {
|
||||
document.documentElement.classList.add('dark');
|
||||
document.documentElement.classList.remove('light');
|
||||
|
||||
} else {
|
||||
document.documentElement.classList.add('light');
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
document.documentElement.setAttribute("data-theme", value);
|
||||
};
|
||||
// Update icon if theme is changed from other sources
|
||||
watch(theme, (val: 'dark' | 'light' | 'system') => {
|
||||
|
@ -20,6 +20,6 @@ const themes: ThemeSwitcherTheme[] = [
|
||||
<template>
|
||||
<div>
|
||||
<NewThemeSwitcher :themes="themes"/>
|
||||
<ThemeSwitcher :themes="themes" />
|
||||
<!-- <ThemeSwitcher :themes="themes" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user