Add some vue magic to product components
not entirely clear what that does, but maybe important..?
This commit is contained in:
parent
4fa08c68ec
commit
10f816cba9
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue