feat: add toast

This commit is contained in:
tim
2025-07-07 13:20:00 +08:00
parent 091af64711
commit 1903be1f82
4 changed files with 12 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import { reactive } from 'vue'
import { toast } from '../main'
export const ThemeMode = {
SYSTEM: 'system',
@@ -40,6 +41,13 @@ export function cycleTheme() {
const modes = [ThemeMode.SYSTEM, ThemeMode.LIGHT, ThemeMode.DARK]
const index = modes.indexOf(themeState.mode)
const next = modes[(index + 1) % modes.length]
if (next === ThemeMode.SYSTEM) {
toast.success('💻 已经切换到系统主题')
} else if (next === ThemeMode.LIGHT) {
toast.success('🌞 已经切换到明亮主题')
} else {
toast.success('🌙 已经切换到暗色主题')
}
setTheme(next)
}