Skip to content

Commit f76cbaa

Browse files
committed
feat: 修复schema 异常更新
1 parent 33a2a74 commit f76cbaa

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

packages/form-render/src/form-core/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ const FormCore:FC<FRProps> = (props) => {
193193
};
194194

195195
const operlabelCol = getFormItemLayout(column, {}, { labelWidth })?.labelCol;
196+
196197
return (
197198
<Form
198199
className={classNames('fr-form', { [className]: !!className } )}

packages/form-render/src/models/validates.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Color from 'color';
22
import { isUrl, isObject, isFunction } from '../utils';
3+
import { cloneDeep } from 'lodash-es';
34

45
const insertLengthRule = (schema: any, rules: any[]) => {
56
const { type, max, min, message } = schema;
@@ -68,7 +69,8 @@ export const transformRules = (rules = [], methods: any, form: any) => {
6869
}));
6970
};
7071

71-
export default (schema: any, form: any, methods: any, fieldRef: any) => {
72+
export default (_schema: any, form: any, methods: any, fieldRef: any) => {
73+
const schema = cloneDeep(_schema);
7274
let {
7375
format,
7476
rules: ruleList = [],

packages/form-render/src/widgets/utils/withFieldWrap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
const getProps = (props: any, filter: any[]) => {
44
const result = {};
5-
5+
66
Object.keys(props).forEach(key => {
77
if (filter.includes(key)) {
88
return;

0 commit comments

Comments
 (0)