Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export component for local use #105

Closed
EricMcRay opened this issue Mar 28, 2018 · 2 comments
Closed

Export component for local use #105

EricMcRay opened this issue Mar 28, 2018 · 2 comments
Assignees

Comments

@EricMcRay
Copy link
Contributor

I just want to suggest export components from main file too to use needed component locally. When I use Vue for SPA, I prefer component injection.

example usage:

import VCalendar, { Calendar, DatePicker, Popover } from 'v-calendar';

new Vue({
  el: '#app'
  components: {
    'v-calendar': Calendar,
    'v-datepicker': DatePicker,
   'v-popover': Popover
  }
})
@nathanreyes
Copy link
Owner

For future viewers, as of v0.9.2 you must import and call setupCalendar before using components

import { setupCalendar, Calendar } from 'v-calendar';

// Call setupCalendar and pass in optional defaults
setupCalendar({
  firstDayOfWeek: 2 // Use Monday instead of Sunday as first day of the week
});

new Vue({
  el: '#app',
  components: {
    'v-calendar': Calendar,
  }
});

@BrendaCayzac
Copy link

@nathanreyes Could you please further explain this?
I copied your code exactly as is in my main.js, but when I try to use it inside another component, it won't recognize any of the changes made by the setupCalendar function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants