File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -64,29 +64,13 @@ export default {
6464 },
6565 data () {
6666 return {
67- logoPath: ( this .$store .getters .darkMode || this . $store . getters . theme === ' dark ' ) ? this .$config .whiteLogo : this .$config .logo
67+ logoPath: this .$store .getters .darkMode ? this .$config .whiteLogo : this .$config .logo
6868 }
6969 },
7070 watch: {
71- ' $store.getters.theme' (theme) {
72- this .logoPath = (this .$store .getters .darkMode || theme === ' dark' ) ? this .$config .whiteLogo : this .$config .logo
73- },
7471 ' $store.getters.darkMode' (darkMode) {
75- document .body .classList .toggle (' dark-mode' , darkMode)
76- this .logoPath = (darkMode || this .$store .getters .theme === ' dark' ) ? this .$config .whiteLogo : this .$config .logo
72+ this .logoPath = darkMode ? this .$config .whiteLogo : this .$config .logo
7773 }
78- },
79- mounted () {
80- // 시스템 테마 변경되었을때 감지 후 테마 변경
81- window .matchMedia (' (prefers-color-scheme: dark)' ).addEventListener (' change' , (event ) => {
82- this .$localStorage .set (' DARK_MODE' , event .matches )
83- this .$store .dispatch (' SetDarkMode' , event .matches )
84- document .body .classList .toggle (' dark-mode' , event .matches )
85- })
86- // 로컬스토리지 다크 모드 확인 후 변경
87- const isDark = !! this .$localStorage .get (' DARK_MODE' )
88- this .$store .dispatch (' SetDarkMode' , isDark)
89- document .body .classList .toggle (' dark-mode' , isDark)
9074 }
9175}
9276 </script >
You can’t perform that action at this time.
0 commit comments