mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
feat(components): [date-picker] add show-now
prop (#18625)
This commit is contained in:
parent
1c1b2743a1
commit
60b899d9bc
@ -111,6 +111,7 @@ datetime-picker/custom-icon
|
||||
| teleported | whether datetime-picker dropdown is teleported to the body | ^[boolean] | true |
|
||||
| empty-values ^(2.7.0) | empty values of component, [see config-provider](/en-US/component/config-provider#empty-values-configurations) | ^[array] | — |
|
||||
| value-on-clear ^(2.7.0) | clear return value, [see config-provider](/en-US/component/config-provider#empty-values-configurations) | ^[string] / ^[number] / ^[boolean] / ^[Function] | — |
|
||||
| show-now ^(2.8.7) | whether to show the now button | ^[boolean] | true |
|
||||
|
||||
## Events
|
||||
|
||||
|
@ -170,7 +170,7 @@
|
||||
</div>
|
||||
<div v-show="footerVisible" :class="ppNs.e('footer')">
|
||||
<el-button
|
||||
v-show="!isMultipleType"
|
||||
v-show="!isMultipleType && showNow"
|
||||
text
|
||||
size="small"
|
||||
:class="ppNs.e('link-btn')"
|
||||
|
@ -57,6 +57,10 @@ export const panelSharedProps = buildProps({
|
||||
},
|
||||
dateFormat: String,
|
||||
timeFormat: String,
|
||||
showNow: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
} as const)
|
||||
|
||||
export const panelRangeSharedProps = buildProps({
|
||||
|
@ -151,6 +151,7 @@
|
||||
:unlink-panels="unlinkPanels"
|
||||
:type="type"
|
||||
:default-value="defaultValue"
|
||||
:show-now="showNow"
|
||||
@pick="onPick"
|
||||
@select-range="setSelectionRange"
|
||||
@set-picker-option="onSetPickerOption"
|
||||
|
@ -227,6 +227,13 @@ export const timePickerDefaultProps = buildProps({
|
||||
},
|
||||
...useEmptyValuesProps,
|
||||
...useAriaProps(['ariaLabel']),
|
||||
/**
|
||||
* @description whether to show the now button
|
||||
*/
|
||||
showNow: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
} as const)
|
||||
|
||||
export type TimePickerDefaultProps = ExtractPropTypes<
|
||||
|
Loading…
Reference in New Issue
Block a user