shu-c-view
Version:
rollup 打包vue@2.7组件库框架
19 lines (17 loc) • 635 B
JavaScript
import _isArray from 'lodash/isArray';
import _isEmpty from 'lodash/isEmpty';
import { devConsole } from '../helper/util.js';
import BaseFitLayout from './fit.vue';
BaseFitLayout.install = function(Vue, ElComponents) {
// 用于按需加载的时候独立使用
devConsole(`按需加载独立组件:${BaseFitLayout.name}`);
if (_isArray(ElComponents) && !_isEmpty(ElComponents)) {
for (let i = 0; i < ElComponents.length; i += 1) {
if (ElComponents[i].name !== BaseFitLayout.name) {
Vue.use(ElComponents[i]);
}
}
}
Vue.component(BaseFitLayout.name, BaseFitLayout);
};
export { BaseFitLayout };