Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Label slot for VDateInput #20060

Closed
Bl00D4NGEL opened this issue Jun 26, 2024 · 4 comments
Closed

[Feature Request] Label slot for VDateInput #20060

Bl00D4NGEL opened this issue Jun 26, 2024 · 4 comments
Assignees
Labels
C: VDateInput T: bug Functionality that does not work as intended/expected
Milestone

Comments

@Bl00D4NGEL
Copy link

Problem to solve

Unable to set a custom label for a VDateInput, however other inputs like VTextField do support custom label slots

Proposed solution

Add the label slot to the VDateInput component

@Drillan767
Copy link

Hello,

You didn't provide a code sample, but here is a working example with a custom label, hope it helps solving your problem

playground

@BreizHell
Copy link

BreizHell commented Aug 26, 2024

Hello @Drillan767, me and my team have the same issue as @Bl00D4NGEL

Currently it is only possible to define a strict string as the label of a v-date-field, through its label prop.

In my team's case, this is a problem, because we need to have a label in black with a red star symbol (*) on the right, to convey its requirement.

This problem would be solved with the addition of a #label slot just like v-text-field.
In the end, we'd like to be able to write something like this :

<v-date-input v-model="birthday"  placeholder="jj/mm/aaaa">
  <template #label>
    Birthday <span class="red-text"><strong>*</strong></span>
  </template>
</v-date-input>

@johnleider johnleider self-assigned this Feb 17, 2025
@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VDateInput and removed S: triage labels Feb 17, 2025
@johnleider johnleider added this to the v3.7.x milestone Feb 17, 2025
@Bl00D4NGEL
Copy link
Author

@johnleider unfortunately your changes in 4815d05 did not fix the issue. It looks like there is still no label slot.

Does this need to be configured in VDateInputSlots? Could something like this

export type VDateInputSlots = Omit<VInputSlots & VFieldSlots, 'default'> & {
  actions: VDateInputActionsSlot
  default: never
}

work here? This is essentially what the VTextField does but adapted to the slots of the VDateInput component

@johnleider
Copy link
Member

@johnleider unfortunately your changes in 4815d05 did not fix the issue. It looks like there is still no label slot.

Does this need to be configured in VDateInputSlots? Could something like this

export type VDateInputSlots = Omit<VInputSlots & VFieldSlots, 'default'> & {
actions: VDateInputActionsSlot
default: never
}
work here? This is essentially what the VTextField does but adapted to the slots of the VDateInput component

It works, just the types are broken. Fixed in d32fa31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDateInput T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

4 participants