feat: integrate upload components into form by default

This commit is contained in:
vben
2020-11-18 23:10:29 +08:00
parent 99303a9987
commit be2b8a7e17
5 changed files with 15 additions and 15 deletions

View File

@@ -158,7 +158,7 @@ export default defineComponent({
) {
rule.type = 'object';
}
if (component.includes('RangePicker')) {
if (component.includes('RangePicker') || component.includes('Upload')) {
rule.type = 'array';
}
if (component.includes('InputNumber')) {

View File

@@ -18,6 +18,7 @@ import {
TreeSelect,
} from 'ant-design-vue';
import RadioButtonGroup from './components/RadioButtonGroup.vue';
import { BasicUpload } from '/@/components/Upload';
const componentMap = new Map<ComponentType, any>();
@@ -48,6 +49,8 @@ componentMap.set('RangePicker', DatePicker.RangePicker);
componentMap.set('WeekPicker', DatePicker.WeekPicker);
componentMap.set('TimePicker', TimePicker);
componentMap.set('Upload', BasicUpload);
export function add(compName: ComponentType, component: Component) {
componentMap.set(compName, component);
}