mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-24 11:05:17 +08:00
fix: allow clearable
to control both of the clear button (#2072)
fix #2035
This commit is contained in:
parent
0d29cc444c
commit
35ae8f4a33
@ -181,6 +181,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="showTime" class="el-picker-panel__footer">
|
<div v-if="showTime" class="el-picker-panel__footer">
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="clearable"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
class="el-picker-panel__link-btn"
|
class="el-picker-panel__link-btn"
|
||||||
@ -578,7 +579,7 @@ export default defineComponent({
|
|||||||
ctx.emit('set-picker-option', ['handleClear', handleClear])
|
ctx.emit('set-picker-option', ['handleClear', handleClear])
|
||||||
|
|
||||||
const pickerBase = inject('EP_PICKER_BASE') as any
|
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 => {
|
watch(() => props.parsedValue, newVal => {
|
||||||
if (newVal && newVal.length === 2) {
|
if (newVal && newVal.length === 2) {
|
||||||
@ -652,6 +653,7 @@ export default defineComponent({
|
|||||||
handleClear,
|
handleClear,
|
||||||
handleConfirm,
|
handleConfirm,
|
||||||
timeFormat,
|
timeFormat,
|
||||||
|
clearable,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user