[dark] change message by theme

Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
MHSanaeiandAlireza Ahmadi committed 2024-02-21 15:32:18 +03:30
1 parent aebf52efb2
commit 660e5ad101
4 files changed
+23 -11

No files matched your search

+5
View File
@@ -21,6 +21,7 @@
this.isDarkTheme = !this.isDarkTheme;
localStorage.setItem('dark-mode', this.isDarkTheme);
document.querySelector('body').setAttribute('class', this.isDarkTheme ? 'dark' : 'light')
document.getElementById('message').className = themeSwitcher.currentTheme;
},
};
}
@@ -31,6 +32,10 @@
props: [],
template: `{{template "component/themeSwitchTemplate"}}`,
data: () => ({ themeSwitcher }),
mounted() {
this.$message.config({getContainer: () => document.getElementById('message')});
document.getElementById('message').className = themeSwitcher.currentTheme;
}
});
</script>
{{end}}