ivew-comps2
Version:
ivew-comps2 公有云平台基础组件库本项目基于
57 lines (50 loc) • 1.13 kB
JavaScript
import wNavWrapper from './components/nav-wrapper';
import wLayout from './components/layout';
import wModal from './components/modal';
import wCountTo from './components/count-to';
import wTreeSelect from './components/tree-select';
import wTable from './components/table';
import wEmpty from './components/empty';
const components = [
wNavWrapper,
wLayout,
wModal,
wCountTo,
wTreeSelect,
wTable,
wEmpty
];
import importMethod from './utils';
import importDirective from './directive';
const install = (Vue) => {
if (install.installed) return;
install.installed = true;
components.map((component) => {
Vue.component(component.name, component);
//或者
// Vue.use(component);
});
//全局注册指令
importDirective(Vue);
//全局方法注册
importMethod(Vue);
};
if (typeof window !== undefined && window.Vue) {
install(window.Vue);
}
export {
install,
importMethod,
importDirective,
wNavWrapper,
wLayout,
wModal,
wCountTo,
wTreeSelect,
wTable,
wEmpty
};
export default {
install,
...components
};