diff --git a/src/base/parser.js b/src/base/parser.js
index 1ae73dc..9ced92a 100644
--- a/src/base/parser.js
+++ b/src/base/parser.js
@@ -43,8 +43,8 @@ function getBasicProps(settings, materials) {
displayType,
showDescIcon,
showValidate,
- formData,
readOnly, // 添加全局控制只读模式
+ formData,
} = settings;
// 目前做了处理的`uiSchema`参数
const {
@@ -100,8 +100,9 @@ function getBasicProps(settings, materials) {
{
...subSchema,
column,
- showDescIcon,
displayType,
+ showDescIcon,
+ showValidate,
readOnly,
formData,
},
diff --git a/src/index.js b/src/index.js
index abace4a..d52fa0c 100755
--- a/src/index.js
+++ b/src/index.js
@@ -25,9 +25,24 @@ function renderField(schema, fields, events) {
}
// 在顶层将 propsSchema 和 uiSchema 合并,便于后续处理。 也可直接传入合并的 schema
-const Wrapper = ({ schema, propsSchema = {}, uiSchema = {}, ...rest }) => {
+const Wrapper = ({
+ schema,
+ propsSchema = {},
+ uiSchema = {},
+ readOnly,
+ showValidate,
+ ...rest
+}) => {
const _schema = schema ? schema : combineSchema(propsSchema, uiSchema);
- return ;
+
+ return (
+
+ );
};
class FormRender extends React.Component {
@@ -82,9 +97,7 @@ class FormRender extends React.Component {
!isDeepEqual(nextProps.schema, schema) ||
!isDeepEqual(Object.keys(nextProps.formData), Object.keys(formData))
) {
- setTimeout(() => {
- this.needUpdateForm();
- }, 0);
+ setTimeout(this.needUpdateForm, 0);
}
}