icehaunter / vue3-datepicker

Simple datepicker component for Vue 3
https://icehaunter.github.io/vue3-datepicker/
MIT License
150 stars 153 forks source link

How to make a global locale config, as well style #69

Closed marcoshmendes closed 1 year ago

marcoshmendes commented 2 years ago

Hello,

I didn't see on docs a way to make a global configuration of locale and style. It's very annoying to add :locale every time i use a datepicker on a large app. Is there any way?

icehaunter commented 1 year ago

There's explicitly no way to do that, as I like my components isolated. I would suggest you add a higher-order component wrapping this one, which would set the :locale prop and CSS variables for styling, and would pass through any other props (attribute fallthrough makes that very easy: https://vuejs.org/guide/components/attrs.html#nested-component-inheritance)