修复问题

This commit is contained in:
2024-08-12 19:34:21 +08:00
parent aa479d22fe
commit 4575d12071
12 changed files with 139 additions and 62 deletions

View File

@@ -23,13 +23,14 @@ const useAppStore = defineStore("app", {
this.$patch(partial)
},
// 改变主题
toggleTheme(dark) {
if (dark) {
this.theme = "dark"
document.body.setAttribute("arco-theme", "dark")
} else {
toggleTheme() {
const currentTheme = document.body.getAttribute("arco-theme")
if (currentTheme === "dark") {
this.theme = "light"
document.body.setAttribute("arco-theme", "light")
} else {
this.theme = "dark"
document.body.setAttribute("arco-theme", "dark")
}
},
// 切换用户设备