Skip to content

Commit

Permalink
feat: installable & directly usable components
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakkulkarni committed Jul 21, 2021
1 parent 6e8c747 commit 102311b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
import { App as Application, Plugin } from 'vue';
import VMap from './components/VMap.vue';
import { setVueInstance } from './utils/config/index';

let installed: boolean = false;

const install: Exclude<Plugin['install'], undefined> = (
instance: Application,
) => {
if (!installed) {
setVueInstance(instance);
instance.component('v-map', VMap);
installed = true;
}
};

export default install;

export { VMap };
export { default as VMap } from './components/VMap.vue';
export { default } from './install';
17 changes: 17 additions & 0 deletions src/install.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { App as Application, Plugin } from 'vue';
import VMap from './components/VMap.vue';
import { setVueInstance } from './utils/config/index';

let installed: boolean = false;

const install: Exclude<Plugin['install'], undefined> = (
instance: Application,
) => {
if (!installed) {
setVueInstance(instance);
instance.component('VMap', VMap);
installed = true;
}
};

export default install;

0 comments on commit 102311b

Please sign in to comment.