lucky 2 gadi atpakaļ
vecāks
revīzija
66fd329860
4 mainītis faili ar 14 papildinājumiem un 11 dzēšanām
  1. 7 7
      src/App.vue
  2. 1 0
      src/assets/css/_themes.scss
  3. 2 0
      src/views/login/index.vue
  4. 4 4
      src/views/product/index.vue

+ 7 - 7
src/App.vue

@@ -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>

+ 1 - 0
src/assets/css/_themes.scss

@@ -7,6 +7,7 @@
 //注意一点是,每套配色方案里的key可以自定义但必须一致,不然就会混乱
 
 $themes: (active1: ( //边框
+
         border_color1: #3d414a,
         //底部导航--------------------------------------
         //文字

+ 2 - 0
src/views/login/index.vue

@@ -111,6 +111,8 @@ export default {
       
       sessionStorage.setItem("type",type)
       this.$store.commit('app/SET_TYPE', type);
+
+      // document.querySelector("#app").setAttribute( "data-theme", type );
       window.document.documentElement.setAttribute( "data-theme", type );
 
     },

+ 4 - 4
src/views/product/index.vue

@@ -333,18 +333,18 @@ export default {
   .productPack {
     width: 100%;
     // .packageBox {
-    //   display: flex;
-    //   justify-content: space-between;
+      // display: flex;
+      // justify-content: space-between;
     // }
 
     li {
       list-style: none;
-      float: left;
+      float: right;
       width: calc(50% - 5px);
       // display: inline-block;
       // padding: 5px;
       &:last-child {
-        float: right;
+        float: left;
       }
       .box {
         background: #e6e6dc;