Explorar el Código

Fix DatePicker style

qingwei.li hace 9 años
padre
commit
01f6b9da7d

+ 1 - 1
examples/docs/input.md

@@ -70,7 +70,7 @@
 
 ## 禁用状态
 
-<div class="demo-box demo-input">  
+<div class="demo-box demo-input">
   <el-input
     :disabled="true"
     placeholder="请输入内容"

+ 1 - 1
packages/date-picker/src/css/date-picker.css

@@ -35,7 +35,7 @@
     @e time-header {
       position: relative;
       border-bottom: 1px solid var(--datepicker-inner-border-color);
-      font-size: 0;
+      font-size: 12px;
       padding: 8px 5px 5px 5px;
       display: flex;
     }

+ 1 - 1
packages/date-picker/src/css/date-range-picker.css

@@ -89,7 +89,7 @@
     @e time-header {
       position: relative;
       border-bottom: 1px solid var(--datepicker-inner-border-color);
-      font-size: 0;
+      font-size: 12px;
       padding: 8px 5px 5px 5px;
       display: flex;
 

+ 12 - 15
packages/date-picker/src/panel/date-range.vue

@@ -115,9 +115,9 @@
         </div>
       </div>
       <div class="el-picker-panel__footer" v-if="showTime">
-        <a
+        <!-- <a
           class="el-picker-panel__link-btn"
-          @click="changeToToday">{{ $t('datepicker.today') }}</a>
+          @click="changeToToday">{{ $t('datepicker.today') }}</a> -->
         <button
           type="button"
           class="el-picker-panel__btn"
@@ -400,18 +400,15 @@
         this.rightTimePickerVisible = false;
       },
 
-      handleLeftTimePick(value) {
-        if (!this.minDate) {
-          this.minDate = new Date();
-        }
-        this.minDate.setHours(value.getHours());
-        this.minDate.setMinutes(value.getMinutes());
-        this.minDate.setSeconds(value.getSeconds());
+      handleLeftTimePick(value, visible, first) {
+        this.minDate = value || this.minDate || new Date();
 
-        this.minDate = new Date(this.minDate);
+        if (!first) {
+          this.leftTimePickerVisible = visible;
+        }
       },
 
-      handleRightTimePick(value) {
+      handleRightTimePick(value, visible, first) {
         if (!this.maxDate) {
           const now = new Date();
           if (now >= this.minDate) {
@@ -420,11 +417,11 @@
         }
 
         if (this.maxDate) {
-          this.maxDate.setHours(value.getHours());
-          this.maxDate.setMinutes(value.getMinutes());
-          this.maxDate.setSeconds(value.getSeconds());
+          this.maxDate = value;
+        }
 
-          this.maxDate = new Date(this.maxDate);
+        if (!first) {
+          this.rightTimePickerVisible = visible;
         }
       },