Innologica / vue2-daterange-picker

Vue2 date range picker
https://innologica.github.io/vue2-daterange-picker/
MIT License
330 stars 209 forks source link

It doesn't seem to be working #191

Closed sumant4ssm closed 4 years ago

sumant4ssm commented 4 years ago

I installed it using the command npm install vue2-daterange-picker --save and imported it in main.js but it's showing below message in main.js where I am importing it. I reinstalled it but didn't seem to fix it. What does this error mean?

module "d:/authorized/dev/product/src/projects/advi/node_modules/vue2-daterange-picker/dist/vue2-daterange-picker.umd.min" Could not find a declaration file for module 'vue2-daterange-picker'. 'd:/authorized/dev/skd-product/src/projects/advisor/node_modules/vue2-daterange-picker/dist/vue2-daterange-picker.umd.min.js' implicitly has an 'any' type. Trynpm install @types/vue2-daterange-pickerif it exists or add a new declaration (.d.ts) file containingdeclare module 'vue2-daterange-picker';``

My import in main.js look like below,

import DateRangePicker from 'vue2-daterange-picker';
Vue.component('DateRangePicker', DateRangePicker);

I tried with Vue.use(DateRangePicker ); but this too didn't solve the issue

I am using the exact code from the example , do I need to add anything apart from below in my vue file `<date-range-picker ref="picker" :opens="opens" :locale-data="{ firstDay: 1, format: 'DD-MM-YYYY HH:mm:ss' }" :minDate="minDate" :maxDate="maxDate" :singleDatePicker="singleDatePicker" :timePicker="timePicker" :timePicker24Hour="timePicker24Hour" :showWeekNumbers="showWeekNumbers" :showDropdowns="showDropdowns" :autoApply="autoApply" v-model="dateRange" @update="updateValues" @toggle="checkOpen" :linkedCalendars="linkedCalendars" :dateFormat="dateFormat"

`

nkostadinov commented 4 years ago

hm, that is something related to you typescript setup. I'm not using TS ... yet so I cannot help. May be you can try with the new version as it is refactored and might work. You setup seems correct and the problem is not the way you use or include the lib. You can try to include the component directly from source. import DateRangePicker from 'vue2-daterange-picker/src/components/DateRangePicker'