V-calendar: Modular usage

Created on 9 Feb 2018  路  8Comments  路  Source: nathanreyes/v-calendar

I want to use only those parts of v-calendar what I really need.
For example, if I need only calendar without date-picker and day-popovers, I don't want to load js and styles of unused components.

Would be great if you make it possible in some of the future releases.
BTW thanks for this great package, it is the best among vue calendars!

discussion

All 8 comments

I have considered splitting the packages, with v-calendar as a dependency for a potential v-date-picker plugin. And perhaps even breakout out v-popover into its own package.

Until now, it has been very convenient to build them out together in a single package, but as the project stabilizes, who knows.

Not sure on how to accomplish this yet. Could include the calendar and picker by default, but allow for importing from v-calendar/core to just pull in the calendar. Or could set it up to only pull in the calendar by default and force importing from v-calendar/picker to get the date picker. Open for suggestions here.

I vote for splitting package. This way package size much more less for anyone who want to use only calendar and date picker over this calendar package is also better that using different datepicker package.

It would be better for development too. While changing some thing for calendar there is a possibility to break date picker and vise versa. I believe decoupling things brings more flexibility and stability. I know it also brings some maintaining difficulties but "great power comes with great responsibility" 馃槃

I think it's better to keep everything in one package.

Could include the calendar and picker by default, but allow for importing from v-calendar/core to just pull in the calendar.

I like this approach, It will be backward compatible with the previous implementation

@shrpne is this #105 what you want? If It is, you can actually use components from VCalendar object but there is some bug right now. some details at #112

Possible usage with current structure:

import VCalendar from 'v-calendar'

new Vue({
  el: '#app'
  components: {
    'v-calendar': VCalendar.Calendar,
    'v-datepicker': VCalendar.DatePicker,
   'v-popover': VCalendar.Popover
  }
});

Yep. This is next on the list. One drawback to the import approach, I believe, is that the CSS is still all bundled together. Still, there isn't an unusually large amount of CSS just for the picker and popover.

This issue will get closed with #105.

Resolved by 19b8d6faba34fb321a3cfcad226fb863805ba3c5.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sokolovdm picture sokolovdm  路  3Comments

Maadtin picture Maadtin  路  3Comments

thfontaine picture thfontaine  路  3Comments

redraw picture redraw  路  3Comments

rcascante picture rcascante  路  3Comments