Add some vue magic to product components

not entirely clear what that does, but maybe important..?
This commit is contained in:
Lance Edgar 2023-01-04 21:54:58 -06:00
parent 4fa08c68ec
commit 10f816cba9

View file

@ -1,6 +1,30 @@
import ByjoveProducts from './ByjoveProducts'
import ByjoveProduct from './ByjoveProduct'
// Declare install function executed by Vue.use()
export function install(Vue) {
if (install.installed) return;
install.installed = true;
Vue.component('ByjoveProducts', ByjoveProducts);
Vue.component('ByjoveProduct', ByjoveProduct);
}
// 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);
}
export {
ByjoveProducts,
ByjoveProduct,