Skip to content

Commit 114d323

Browse files
committed
fix(ProForm): 修复ts报错
1 parent 4b2a610 commit 114d323

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

examples/base/src/pages/Demo/Detail/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ const Detail = ({ updateData }: DetailProps) => {
5656
if (errors && Object.keys(errors).length > 0) return
5757
if (errors2 && Object.keys(errors2).length > 0) return
5858
// 调用接口
59+
const datas1 = form.getFieldValues() || {}
60+
const datas2 = form.getFieldValues() || {}
61+
console.log('obj', { ...datas1, ...datas2 })
5962
}
6063

6164
return (

examples/base/src/pages/Demo/Detail/items.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const items = (queryInfo: any, attr: any) => [
174174
label: 'searchSelect2',
175175
key: 'searchSelect2',
176176
widget: 'searchSelect',
177-
// option: attr.searchSelect.option,
177+
option: attr.searchSelect.option,
178178
widgetProps: {
179179
labelInValue: true,
180180
allowClear: true,

packages/components/src/ProForm/formdom.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ function FormDom({
1111
onSubmit,
1212
onChange,
1313
onSubmitError,
14-
// afterSubmit,
1514
buttonsContainer,
1615
showSaveButton = false,
1716
showResetButton = false,
@@ -72,7 +71,7 @@ function FormDom({
7271
}}
7372
fields={formfields}
7473
>
75-
{({ fields, state, canSubmit, resetForm }) => {
74+
{({ fields = {}, state, canSubmit = () => false, resetForm }) => {
7675
return (
7776
<React.Fragment>
7877
<Row gutter={10}>

packages/components/src/ProForm/readform.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { Descriptions } from 'uiw';
32
import { ProFormProps } from './type';
43
import { getReadValue } from './utils/index';

packages/components/src/ProTable/BaseForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const BaseForm: React.FC<BaseFormProps> = (props) => {
133133
ref={formRef}
134134
fields={getFormFields}
135135
>
136-
{({ fields, state, canSubmit, resetForm }) => {
136+
{({ fields = {}, state, canSubmit, resetForm }) => {
137137
return (
138138
<div>
139139
<Row gutter={12}>

0 commit comments

Comments
 (0)