|
@ -14,6 +14,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
document.body.classList.add(this.theme); |
|
|
document.body.classList.add(this.theme); |
|
|
|
|
|
this.updateThemeColorMeta(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
computed: { |
|
|
computed: { |
|
@ -33,6 +34,17 @@ export default { |
|
|
theme(to, from) { |
|
|
theme(to, from) { |
|
|
document.body.classList.remove(from); |
|
|
document.body.classList.remove(from); |
|
|
document.body.classList.add(this.theme); |
|
|
document.body.classList.add(this.theme); |
|
|
|
|
|
this.updateThemeColorMeta(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
updateThemeColorMeta() { |
|
|
|
|
|
if (this.theme === "dark") { |
|
|
|
|
|
document.querySelector("#theme-color").setAttribute("content", "#161B22"); |
|
|
|
|
|
} else { |
|
|
|
|
|
document.querySelector("#theme-color").setAttribute("content", "#5cdd8b"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|