Skip to content

Commit

Permalink
feat: fix the form is displayed incorrectly
Browse files Browse the repository at this point in the history
fix the problem that the form is displayed incorrectly when the
delete
button is clicked in the online debugging view.
Modify the
code
according to antd documentation.
https://ant.design/components/form-cn/#components-form-demo-dynamic-form-item
  • Loading branch information
qian0817 committed Mar 28, 2021
1 parent 314f6ca commit 7f7d503
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions web/src/pages/Route/components/DebugViews/DebugParamsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,20 @@ const DebugParamsView: React.FC<RouteModule.DebugViewProps> = (props) => {
<Row gutter={16} key={field.name}>
<Col span={1}>
<Form.Item
{...field}
name={[field.name, 'check']}
fieldKey={[field.fieldKey, 'check']}
style={{ textAlign: 'right' }}
valuePropName="checked"
>
{fields.length > 1 && index !== fields.length - 1 && <Checkbox />}
</Form.Item>
</Col>
<Col span={8}>
<Form.Item name={[field.name, 'key']}>
<Form.Item
{...field}
name={[field.name, 'key']}
fieldKey={[field.fieldKey, 'key']}>
<AutoComplete
onSearch={onSearch}
placeholder={formatMessage({ id: 'page.route.input.placeholder.paramKey' })}
Expand All @@ -75,7 +80,10 @@ const DebugParamsView: React.FC<RouteModule.DebugViewProps> = (props) => {
</Form.Item>
</Col>
<Col span={8}>
<Form.Item name={[field.name, 'value']}>
<Form.Item
{...field}
name={[field.name, 'value']}
fieldKey={[field.fieldKey, 'value']}>
<Input
placeholder={formatMessage({
id: 'page.route.input.placeholder.paramValue',
Expand Down

0 comments on commit 7f7d503

Please sign in to comment.