Support for ssr is planned?
Also would love SSR support. It doesn't appear to be too difficult after scanning the codebase.
Meanwhile, for NUXT:
// plugins/datepicker.js
import DatePicker from 'vue2-datepicker'
import Vue from 'vue'
Vue.component('date-picker', DatePicker)
// nuxt.config.js
plugins: [
{ src: '~/plugins/datepicker', ssr: false }
],
// Component.vue
<template>
<no-ssr>
<date-picker />
</no-ssr>
</template>
Wow datepicker doesn't work in Node + ExpresJS because window is not defined.
How do I fix that?
@volokolamskspb you'd have to fork and fix the issue.
@antony good job
import Vue from 'vue'
import DatePicker from 'vue2-datepicker'
import 'vue2-datepicker/index.css';
Vue.use(DatePicker)
We might need index.css for styling too on plugins/datepicker.js
You definitely need index.css, or you get an SVG icon that fills up half your page, and no calendar.
Do we have any official fix for this amazing datepicker to work with nuxt?
Most helpful comment
Also would love SSR support. It doesn't appear to be too difficult after scanning the codebase.
Meanwhile, for NUXT: