UNPKG

hongluan-business-ui

Version:
25 lines (22 loc) 592 B
import { PREFIX } from './constants.mjs'; const withInstall = (main, extra) => { main.install = (app) => { for (const comp of [main, ...Object.values(extra != null ? extra : {})]) { app.component(PREFIX + comp.name, comp); } }; if (extra) { for (const [key, comp] of Object.entries(extra)) { main[key] = comp; } } return main; }; const withInstallFunction = (fn, name) => { fn.install = (app) => { app.config.globalProperties[name] = fn; }; return fn; }; export { withInstall, withInstallFunction }; //# sourceMappingURL=with-install.mjs.map