fix: allow clearable to control both of the clear button (#2072)

fix #2035
This commit is contained in:
0song 2021-05-26 16:31:04 +08:00 committed by GitHub
parent 0d29cc444c
commit 35ae8f4a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,6 +181,7 @@
</div>
<div v-if="showTime" class="el-picker-panel__footer">
<el-button
v-if="clearable"
size="mini"
type="text"
class="el-picker-panel__link-btn"
@ -578,7 +579,7 @@ export default defineComponent({
ctx.emit('set-picker-option', ['handleClear', handleClear])
const pickerBase = inject('EP_PICKER_BASE') as any
const { shortcuts, disabledDate, cellClassName, format, defaultTime, defaultValue, arrowControl } = pickerBase.props
const { shortcuts, disabledDate, cellClassName, format, defaultTime, defaultValue, arrowControl, clearable } = pickerBase.props
watch(() => props.parsedValue, newVal => {
if (newVal && newVal.length === 2) {
@ -652,6 +653,7 @@ export default defineComponent({
handleClear,
handleConfirm,
timeFormat,
clearable,
}
},
})