Skip to content

Commit

Permalink
fix: call vue-component inside install function
Browse files Browse the repository at this point in the history
  • Loading branch information
swaprenge committed Jan 12, 2021
1 parent f1fffd4 commit 677290b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import GridItem from './GridItem.vue';
import GridLayout from './GridLayout.vue';
// import ResponsiveGridLayout from './ResponsiveGridLayout.vue';

const VueGridLayout = {
// ResponsiveGridLayout,
GridLayout,
GridItem,
};

export function install(Vue) {
if (install.installed) return;
install.installed = true;
Object.keys(VueGridLayout).forEach((name) => {
Vue.component(name, VueGridLayout[name]);
});
}

const plugin = {
install,
};

let GlobalVue = null;
if (typeof window !== 'undefined') {
GlobalVue = window.Vue;
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue;
}
if (GlobalVue) {
GlobalVue.use(plugin);
}

export default VueGridLayout;
export { GridLayout, GridItem };

0 comments on commit 677290b

Please sign in to comment.