|
@@ -16,16 +16,16 @@ export default {
|
|
|
mounted() {
|
|
|
// this.theme('light')
|
|
|
// this.theme('dark')
|
|
|
+ let type = sessionStorage.getItem("type");
|
|
|
+ this.theme(type)
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- // theme(type) {
|
|
|
-
|
|
|
- // // this.$store.commit('upDate', {themeType: type});
|
|
|
- // sessionStorage.setItem("type",type)
|
|
|
- // window.document.documentElement.setAttribute( "data-theme", type );
|
|
|
-
|
|
|
- // }
|
|
|
+ theme(type) {
|
|
|
+ sessionStorage.setItem("type",type)
|
|
|
+ this.$store.commit('app/SET_TYPE', type);
|
|
|
+ window.document.documentElement.setAttribute( "data-theme", type );
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|