Commit 699f9f67 authored by XieZhiXiong's avatar XieZhiXiong

chore: 修改 area 渲染

parent f9a36f65
import React from 'react';
import { PATTERN_MAPS } from '@/constants/regExp';
import PicWrap from './components/PicWrap';
export type ElementType = {
/**
......@@ -194,4 +196,23 @@ export function createMemberSchema(elements: ElementType[]) {
components[item.fieldName as string] = getFieldType(item);
}
return components;
};
// 根据 fieldType 渲染对应的内容
export function renderFieldTypeContent(fieldType: FieldType, fieldValue: any): React.ReactNode {
// 默认渲染 string
let node: React.ReactNode = fieldValue;
switch (fieldType) {
case 'upload':
node = (
<PicWrap
pics={[fieldValue.fieldValue]}
/>
);
break;
default:
break;
}
return node;
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment