mathieustan / vue-datepicker

A clean datepicker made with VueJs
https://vue-datepicker.netlify.com/
MIT License
165 stars 47 forks source link

Getting "window is not defined" on Nuxt #101

Open sindrepm opened 2 years ago

sindrepm commented 2 years ago

Thanks for a great component! I'm using it in my Nuxt project, but so far I've not been able to get it to work with SSR.

I'm getting a "ReferenceError: window is not defined" in "vue-datepicker.umd.js" function "VueComponent.created".

So I have to wrap it in a ClientOnly tag as a workaround, but this doesn't give the best UX because the input field is initially hidden when the page loads.

Anyway to fix this?