forked from ManukMinasyan/vue-functional-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
28 lines (24 loc) · 768 Bytes
/
index.js
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
// Import vue component
import component from './src/components/FunctionalCalendar';
// Declaring an installation function performed by Vue.use ()
export function install(Vue) {
if (install.installed) return;
install.installed = true;
Vue.component('FunctionalCalendar', component);
}
// Creating a module value for Vue.use ()
const plugin = {
install
};
// Automatic installation when vue is found (for example, in the browser using the <script> tag)
let GlobalVue = null;
if (typeof window !== 'undefined') {
GlobalVue = window.Vue;
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue;
}
if (GlobalVue) {
GlobalVue.use(plugin);
}
// Export component for use as a module (npm / webpack / etc.)
export default component;