From 35c040880867b2845673b84089d325b1d9d50de8 Mon Sep 17 00:00:00 2001 From: yuya-2017 Date: Sat, 11 Jan 2025 22:49:46 +0900 Subject: [PATCH] feat(VDateInput): add slot for customizing VDatePicker actions --- packages/vuetify/src/labs/VDateInput/VDateInput.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/vuetify/src/labs/VDateInput/VDateInput.tsx b/packages/vuetify/src/labs/VDateInput/VDateInput.tsx index 54202f7cddc..accfdc7fcea 100644 --- a/packages/vuetify/src/labs/VDateInput/VDateInput.tsx +++ b/packages/vuetify/src/labs/VDateInput/VDateInput.tsx @@ -15,8 +15,9 @@ import { computed, shallowRef } from 'vue' import { genericComponent, omit, propsFactory, useRender, wrapInArray } from '@/util' // Types -export interface VDateInputSlots { +export type VDateInputSlots = { default: never + actions: never } export const makeVDateInputProps = propsFactory({ @@ -34,7 +35,7 @@ export const makeVDateInputProps = propsFactory({ }), ['active']), }, 'VDateInput') -export const VDateInput = genericComponent()({ +export const VDateInput = genericComponent()({ name: 'VDateInput', props: makeVDateInputProps(), @@ -146,7 +147,12 @@ export const VDateInput = genericComponent()({ onMousedown={ (e: MouseEvent) => e.preventDefault() } > {{ - actions: !props.hideActions ? actions : undefined, + actions: () => { + if (slots.actions) { + return slots.actions() + } + return !props.hideActions ? actions() : undefined + }, }} )