praveenpuglia / vuetify-daterange-picker

The missing date range picker for Vuetify JS you have been looking for.
https://vuetify-daterange-picker.gitbook.io/docs
MIT License
197 stars 59 forks source link

Importing the date picker locally do not work #38

Closed Rolanddoda closed 5 years ago

Rolanddoda commented 5 years ago

I imported these:

import DateRange from 'vuetify-daterange-picker';
import 'vuetify-daterange-picker/dist/vuetify-daterange-picker.css';

And this on components section:

export default {
    components: { DateRange.name: DateRange },

Obviously this won't work

praveenpuglia commented 5 years ago

You need to install it as a plugin. Did you do that? If you do, you won't have to import it in component like so.

https://github.com/praveenpuglia/vuetify-daterange-picker#usage

Rolanddoda commented 5 years ago

I followed the instructions to import it only in one component. I don't want to install it globally with Vue.use()

praveenpuglia commented 5 years ago

32 was about similar issue but it's solved now. Can you please post the error you get?

markhilton commented 5 years ago

I was able to import component locally with:

export default {
    components: { 'v-daterange': VDateRange },

but I am getting errors: Unknown custom element: , , etc.

I have VUE CLI 3 project with TypeScript and Vuetify plugin installed.

lbogdan commented 5 years ago

@praveenpuglia Looks like you're only exporting the default (and not the DateRange component) from https://github.com/praveenpuglia/vuetify-daterange-picker/blob/master/src/index.js ?

praveenpuglia commented 5 years ago

Ah! Thanks a ton @lbogdan. Sorry, I didn't have the time to look into it so far because of busy day job. Would you like to send a PR ? I am more than happy to merge one. :)

praveenpuglia commented 5 years ago

Fixed in v2.6.2 - https://github.com/praveenpuglia/vuetify-daterange-picker/releases/tag/v2.6.2

The readme is also updated with the import syntax.

// If you want to use in one of your components.
import { DateRange } from 'vuetify-daterange-picker';
import 'vuetify-daterange-picker/dist/vuetify-daterange-picker.css';

export default {
  components: { [DateRange.name]: DateRange },
  ...
};