@appscode/ui-builder
Version:
## Motivation
46 lines (36 loc) • 1.17 kB
JavaScript
import UiBuilder from "@/views/UiBuilder.vue";
// import wizard store module
import wizard from "@/store/wizard.js";
import { initVeeValidate } from "@/plugins/vee-validate";
import { addGlobalTranslateFunc } from "@/plugins/vue-i18n";
// install function executed by Vue.use()
export function install(Vue, { store, storeOptions, i18n }) {
if (install.installed) return;
install.installed = true;
// expand store module
store.registerModule("wizard", wizard, storeOptions);
// initialize vee validate
initVeeValidate();
// globally register ui builder translate function
addGlobalTranslateFunc(Vue, i18n);
Vue.component("ui-builder", UiBuilder);
}
// Create module definition for Vue.use()
const plugin = {
install,
};
// To auto-install when vue is found
// eslint-disable-next-line no-redeclare
/* global window, global */
let GlobalVue = null;
if (typeof window !== "undefined") {
GlobalVue = window.Vue;
} else if (typeof global !== "undefined") {
GlobalVue = global.Vue;
}
if (GlobalVue) {
GlobalVue.use(plugin);
}
// Default export is library as a whole, registered via Vue.use()
export default plugin;
// export default UiBuilder;