[dark] change message by theme

This commit is contained in:
Alireza Ahmadi
2024-02-20 22:12:51 +01:00
parent 035a1a7b5e
commit 6cdeb7ebeb
3 changed files with 12 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
toggleTheme() {
this.isDarkTheme = !this.isDarkTheme;
localStorage.setItem('dark-mode', this.isDarkTheme);
document.getElementById('message').className = themeSwitcher.currentTheme;
},
};
}
@@ -29,6 +30,10 @@
props: [],
template: `{{template "component/themeSwitchTemplate"}}`,
data: () => ({ themeSwitcher }),
mounted() {
this.$message.config({getContainer: () => document.getElementById('message')});
document.getElementById('message').className = themeSwitcher.currentTheme;
}
});
</script>
{{end}}