update theme header
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
<template>
|
||||
<v-switch
|
||||
class="theme-switch"
|
||||
v-model="mode"
|
||||
@change="themeChange"
|
||||
></v-switch>
|
||||
<a-button
|
||||
class="btn-header"
|
||||
:color="mode ? 'dark' : 'light'"
|
||||
@click="themeChange"
|
||||
icon="bulb"
|
||||
>
|
||||
</a-button>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex';
|
||||
@ -26,8 +28,11 @@ export default {
|
||||
setThemeChange: 'setThemeChange',
|
||||
}),
|
||||
themeChange() {
|
||||
this.mode = !this.mode;
|
||||
this.$vuetify.theme.isDark = this.mode;
|
||||
this.setThemeChange(this.mode);
|
||||
console.log(this.mode)
|
||||
console.log(this.$vuetify.theme.isDark)
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -69,12 +74,14 @@ export default {
|
||||
background-color: #f2f2f2;
|
||||
top: 2px;
|
||||
left: 0;
|
||||
background-image: url(../../assets/images/icon/ico-theme-light.png);
|
||||
// background-image: url(../../assets/images/icon/ico-theme-light.png);
|
||||
content: "light";
|
||||
background-size: 18px 18px;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
&.v-input--is-label-active {
|
||||
::v-deep {
|
||||
.v-input--switch__track {
|
||||
@ -82,7 +89,8 @@ export default {
|
||||
}
|
||||
.v-input--switch__thumb {
|
||||
// transform: translate(38px, 0);
|
||||
background-image: url(../../assets/images/icon/ico-theme-dark.png);
|
||||
// background-image: url(../../assets/images/icon/ico-theme-dark.png);
|
||||
content: 'dark';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user