Skip to content

Conversation

olemarius
Copy link
Contributor

Adding v-bind="$attrs" to DatePicker allows fine-grained control over the underlying v-calendar component's API.

@sadeghbarati
Copy link
Collaborator

@sadeghbarati
Copy link
Collaborator

IMO, let's wait for Infer attrs (Vue 3.4) cause v-calendar does not provide any types to set it easily in the defineProps section

@olemarius
Copy link
Contributor Author

@sadeghbarati thanks for pointing that out! Also agree it's better to wait for Infer attrs, wasn't aware of that rfc.

So for now, the workaround is to modify your own local copy of the Calendar.vue component with

defineOptions({
  inheritAttrs: false
})

and

<DatePicker 
  v-bind="$attrs" 
  ...  
/>

Copy link
Member

@zernonia zernonia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@zernonia zernonia merged commit 03e1fce into unovue:dev Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants