This commit is contained in:
syuilo 2018-04-22 17:43:02 +09:00
parent 1300984b12
commit f52aafb158

View file

@ -82,12 +82,12 @@ Vue.mixin({
methods: {
_updateDarkmode_(v) {
localStorage.setItem('darkmode', v.toString());
bus.$emit('updated', v);
if (v) {
document.documentElement.setAttribute('data-darkmode', 'true');
} else {
document.documentElement.removeAttribute('data-darkmode');
}
bus.$emit('updated', v);
},
_onDarkmodeUpdated_(v) {
if (!this.$el || !this.$el.setAttribute) return;