All files / src lib.js

0% Statements 0/22
0% Branches 0/8
0% Functions 0/3
0% Lines 0/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29                                                         
import Calendar from './components/Calendar';
import DatePicker from './components/DatePicker';
import Popover from './components/Popover';
import { mergeDefaults } from './utils/defaults';
 
const componentPrefix = 'v';
 
const components = {
  Calendar,
  DatePicker,
  Popover,
};
 
const VCalendar = {
  ...components,
  install: (Vue, options) => {
    mergeDefaults(options);
    Object
      .keys(components)
      .forEach(k => Vue.component(`${componentPrefix}${k}`, components[k]));
  },
};
 
export default VCalendar;
 
if (typeof window !== 'undefined' && window.Vue) {
  window.Vue.use(VCalendar);
}