UNPKG

hongluan-business-ui

Version:
30 lines (25 loc) 722 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var constants = require('./constants.js'); const withInstall = (main, extra) => { main.install = (app) => { for (const comp of [main, ...Object.values(extra != null ? extra : {})]) { app.component(constants.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; }; exports.withInstall = withInstall; exports.withInstallFunction = withInstallFunction; //# sourceMappingURL=with-install.js.map