vben
2020-12-31 9c2f3f30bbd8abcccc4f256183ed7794da7fcda2
提交 | 用户 | age
9c2f3f 1 import type { Component } from 'vue';
faf3f4 2
3 import { Input, Select, Checkbox, InputNumber, Switch } from 'ant-design-vue';
4
9c2f3f 5 import type { ComponentType } from './types/componentType';
V 6 import { ApiSelect } from '/@/components/Form';
faf3f4 7
8 const componentMap = new Map<ComponentType, Component>();
9
10 componentMap.set('Input', Input);
11 componentMap.set('InputNumber', InputNumber);
12
13 componentMap.set('Select', Select);
9c2f3f 14 componentMap.set('ApiSelect', ApiSelect);
faf3f4 15 componentMap.set('Switch', Switch);
16 componentMap.set('Checkbox', Checkbox);
17
18 export function add(compName: ComponentType, component: Component) {
19   componentMap.set(compName, component);
20 }
21
22 export function del(compName: ComponentType) {
23   componentMap.delete(compName);
24 }
25
26 export { componentMap };