add vuejs wrapper for component.

This commit is contained in:
Miroslav Šedivý
2021-01-21 16:01:23 +01:00
parent c48caf32eb
commit 1def45f2a1
3 changed files with 29 additions and 11 deletions

22
src/index.ts Normal file
View File

@ -0,0 +1,22 @@
import Vue from 'vue';
import Neko from './component/main.vue'
/**
* Fügt eine "install" function hinzu
*
* Weitere Infos:
* https://vuejs.org/v2/cookbook/packaging-sfc-for-npm.html#Packaging-Components-for-npm
*/
const NekoElements = {
install(vue: typeof Vue): void {
vue.component('Neko', Neko);
},
};
if (typeof window !== 'undefined' && window.Vue) {
// @ts-ignore
window.Vue.use(NekoElements, {});
}
export { Neko };
export default NekoElements;