fix: 切换主题不成功

This commit is contained in:
LOG1997
2025-01-09 20:42:49 +08:00
parent 2fe90a14dd
commit 9a805c9024
4 changed files with 12 additions and 8 deletions

View File

@@ -39,3 +39,12 @@ export function selectCard(cardIndexArr: number[], tableLength: number, personId
return cardIndex
}
export function themeChange(theme: string) {
// 获取根html
const html = document.querySelectorAll('html')
if (html) {
html[0].setAttribute('data-theme', theme)
localStorage.setItem('theme', theme)
}
}