DatePicker: fix disabled in range mode

pull/7537/head^2
Leopoldthecoder 2017-10-18 19:20:48 +08:00 committed by 杨奕
parent 3f12de1f79
commit bd0114454e
2 changed files with 28 additions and 1 deletions

View File

@ -31,7 +31,8 @@
class="el-date-editor el-range-editor el-input__inner"
:class="[
'el-date-editor--' + type,
'el-range-editor--' + pickerSize,
pickerSize ? `el-range-editor--${ pickerSize }` : '',
disabled ? 'is-disabled' : '',
pickerVisible ? 'is-active' : ''
]"
@click="handleRangeClick"
@ -45,6 +46,7 @@
<input
:placeholder="startPlaceholder"
:value="displayValue && displayValue[0]"
:disabled="disabled"
@input="handleStartInput"
@change="handleStartChange"
@focus="handleFocus"
@ -53,6 +55,7 @@
<input
:placeholder="endPlaceholder"
:value="displayValue && displayValue[1]"
:disabled="disabled"
@input="handleEndInput"
@change="handleEndChange"
@focus="handleFocus"

View File

@ -146,4 +146,28 @@
line-height: 20px;
}
}
@include when(disabled) {
background-color: $--input-disabled-fill;
border-color: $--input-disabled-border;
color: $--input-disabled-color;
cursor: not-allowed;
&:hover, &:focus {
border-color: $--input-disabled-border;
}
input {
background-color: $--input-disabled-fill;
color: $--input-disabled-color;
cursor: not-allowed;
&::placeholder {
color: $--input-disabled-placeholder-color;
}
}
.el-range-separator {
color: $--input-disabled-color;
}
}
}