diff --git a/packages/vuetify/src/labs/VDateInput/VDateInput.tsx b/packages/vuetify/src/labs/VDateInput/VDateInput.tsx index 54202f7cddc..9cdba2b3774 100644 --- a/packages/vuetify/src/labs/VDateInput/VDateInput.tsx +++ b/packages/vuetify/src/labs/VDateInput/VDateInput.tsx @@ -15,7 +15,14 @@ import { computed, shallowRef } from 'vue' import { genericComponent, omit, propsFactory, useRender, wrapInArray } from '@/util' // Types -export interface VDateInputSlots { +export type VDateInputActionsSlot = { + save: () => void + cancel: () => void + isPristine: boolean +} + +export type VDateInputSlots = { + actions: VDateInputActionsSlot default: never } @@ -34,7 +41,7 @@ export const makeVDateInputProps = propsFactory({ }), ['active']), }, 'VDateInput') -export const VDateInput = genericComponent()({ +export const VDateInput = genericComponent()({ name: 'VDateInput', props: makeVDateInputProps(), @@ -127,9 +134,10 @@ export const VDateInput = genericComponent()({ { ...confirmEditProps } v-model={ model.value } onSave={ onSave } + onCancel={ () => menu.value = false } > {{ - default: ({ actions, model: proxyModel }) => { + default: ({ actions, model: proxyModel, save, cancel, isPristine }) => { return ( e.preventDefault() } > {{ - actions: !props.hideActions ? actions : undefined, + actions: !props.hideActions ? () => slots.actions?.({ save, cancel, isPristine }) ?? actions() : undefined, }} )