66 lines
1.7 KiB
JavaScript
66 lines
1.7 KiB
JavaScript
// 导入组件
|
||
import agInput from './agInput/index';
|
||
import agSelect from './agSelect/index';
|
||
import agUpload from './agUpload';
|
||
import agForm from './agForm';
|
||
import agColorPicker from './agColorPicker';
|
||
import agQuery from './agQuery';
|
||
import agTable from './agTable';
|
||
import agTabs from './agTabs';
|
||
import agDialog from './agDialog';
|
||
import agPagination from './agPagination';
|
||
import agRow from './agRow';
|
||
import agCol from './agCol';
|
||
import agMutionCheckbox from './agMutionCheckbox';
|
||
import agSearch from './agSearch';
|
||
import agDatePicker from "./agDatePicker";
|
||
import agNumberRange from "./agNumberRange";
|
||
import agMultionDatePicker from "./agMultionDatePicker";
|
||
import agMultionInput from "./agMultionInput";
|
||
|
||
// 注册组件
|
||
|
||
// 组件列表
|
||
const components = [
|
||
agInput,
|
||
agSelect,
|
||
agUpload,
|
||
agForm,
|
||
agColorPicker,
|
||
agQuery,
|
||
agTable,
|
||
agDialog,
|
||
agTabs,
|
||
agPagination,
|
||
agCol,
|
||
agRow,
|
||
agDatePicker,
|
||
agMutionCheckbox,
|
||
agSearch,
|
||
agNumberRange,
|
||
agMultionDatePicker,
|
||
agMultionInput
|
||
]
|
||
|
||
// 定义 install 方法,接收 Vue 作为参数(使用 use 注册插件,那么所有的组件都会被注册)
|
||
const install = function (Vue) {
|
||
// 判断是否安装
|
||
if (install.installed) return
|
||
// 遍历注册全局组件
|
||
components.forEach(component => {
|
||
Vue.component(component.name, component);
|
||
});
|
||
}
|
||
|
||
// 判断是否是直接引入文件
|
||
if (typeof window !== 'undefined' && window.Vue) {
|
||
install(window.Vue)
|
||
}
|
||
|
||
export default {
|
||
version:'2.15.14',
|
||
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
|
||
install,
|
||
// 以下是具体的组件列表
|
||
...components
|
||
} |