neko/src/wrapper.js
Miroslav Šedivý fa28f2c6ee inital commit.
2020-11-05 11:56:26 +01:00

29 lines
647 B
JavaScript

// Import vue component
import Neko from './Neko.vue';
// Declare install function executed by Vue.use()
export function install(Vue) {
if (install.installed) return;
install.installed = true;
Vue.component('Neko', Neko);
}
// Create module definition for Vue.use()
const plugin = {
install,
};
// Auto-install when vue is found (eg. in browser via <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);
}
// To allow use as module (npm/webpack/etc.) export Neko
export default Neko;