mirror of https://github.com/ElemeFE/element
Fix DatePicker style
parent
951c3de1bf
commit
01f6b9da7d
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
## 禁用状态
|
## 禁用状态
|
||||||
|
|
||||||
<div class="demo-box demo-input">
|
<div class="demo-box demo-input">
|
||||||
<el-input
|
<el-input
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
@e time-header {
|
@e time-header {
|
||||||
position: relative;
|
position: relative;
|
||||||
border-bottom: 1px solid var(--datepicker-inner-border-color);
|
border-bottom: 1px solid var(--datepicker-inner-border-color);
|
||||||
font-size: 0;
|
font-size: 12px;
|
||||||
padding: 8px 5px 5px 5px;
|
padding: 8px 5px 5px 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
@e time-header {
|
@e time-header {
|
||||||
position: relative;
|
position: relative;
|
||||||
border-bottom: 1px solid var(--datepicker-inner-border-color);
|
border-bottom: 1px solid var(--datepicker-inner-border-color);
|
||||||
font-size: 0;
|
font-size: 12px;
|
||||||
padding: 8px 5px 5px 5px;
|
padding: 8px 5px 5px 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
|
|
@ -115,9 +115,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-picker-panel__footer" v-if="showTime">
|
<div class="el-picker-panel__footer" v-if="showTime">
|
||||||
<a
|
<!-- <a
|
||||||
class="el-picker-panel__link-btn"
|
class="el-picker-panel__link-btn"
|
||||||
@click="changeToToday">{{ $t('datepicker.today') }}</a>
|
@click="changeToToday">{{ $t('datepicker.today') }}</a> -->
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="el-picker-panel__btn"
|
class="el-picker-panel__btn"
|
||||||
|
@ -400,18 +400,15 @@
|
||||||
this.rightTimePickerVisible = false;
|
this.rightTimePickerVisible = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
handleLeftTimePick(value) {
|
handleLeftTimePick(value, visible, first) {
|
||||||
if (!this.minDate) {
|
this.minDate = value || this.minDate || new Date();
|
||||||
this.minDate = new Date();
|
|
||||||
}
|
|
||||||
this.minDate.setHours(value.getHours());
|
|
||||||
this.minDate.setMinutes(value.getMinutes());
|
|
||||||
this.minDate.setSeconds(value.getSeconds());
|
|
||||||
|
|
||||||
this.minDate = new Date(this.minDate);
|
if (!first) {
|
||||||
|
this.leftTimePickerVisible = visible;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
handleRightTimePick(value) {
|
handleRightTimePick(value, visible, first) {
|
||||||
if (!this.maxDate) {
|
if (!this.maxDate) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
if (now >= this.minDate) {
|
if (now >= this.minDate) {
|
||||||
|
@ -420,11 +417,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.maxDate) {
|
if (this.maxDate) {
|
||||||
this.maxDate.setHours(value.getHours());
|
this.maxDate = value;
|
||||||
this.maxDate.setMinutes(value.getMinutes());
|
}
|
||||||
this.maxDate.setSeconds(value.getSeconds());
|
|
||||||
|
|
||||||
this.maxDate = new Date(this.maxDate);
|
if (!first) {
|
||||||
|
this.rightTimePickerVisible = visible;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue