Browse Source

时间选择器

maxiaoxiao 1 năm trước cách đây
mục cha
commit
effe120623
2 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 2 1
      src/views/cockpit/datePicker.vue
  2. 2 1
      src/views/cockpitNew1/datePicker.vue

+ 2 - 1
src/views/cockpit/datePicker.vue

@@ -60,10 +60,11 @@ export default {
         ],
       },
       // dateValue: [`${nowYear}-01-01`, `${nowYear}-${nowMonth}-${nowDay}`]
-      dateValue: [`${nowYear}0101`, `${nowYear}${nowMonth}${nowDay}`],
+      dateValue: [`${nowYear}0101`, new Date().format("yyyyMMdd")],
     };
   },
   mounted() {
+    console.log(this.dateValue)
     this.dateChange();
   },
   methods: {

+ 2 - 1
src/views/cockpitNew1/datePicker.vue

@@ -60,7 +60,7 @@ export default {
         ],
       },
       // dateValue: [`${nowYear}-01-01`, `${nowYear}-${nowMonth}-${nowDay}`]
-      dateValue: [`${nowYear}0101`, `${nowYear}${nowMonth}${nowDay}`],
+      dateValue: [`${nowYear}0101`, new Date().format("yyyyMMdd")],
     };
   },
   mounted() {
@@ -68,6 +68,7 @@ export default {
   },
   methods: {
     dateChange() {
+      console.log(this.dateValue)
       this.$emit("dateChange", this.dateValue);
       store.setCockpitDate(this.dateValue);
     },