hongluan-business-ui
Version:
Hongluan Business Component Library for Vue 3
25 lines (22 loc) • 592 B
JavaScript
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