mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-11 23:00:20 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
51 lines
790 B
Markdown
51 lines
790 B
Markdown
---
|
|
order: 99
|
|
title:
|
|
zh-CN: Dep Debug
|
|
en-US: Dep Debug
|
|
debug: true
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
Buggy!
|
|
|
|
## en-US
|
|
|
|
Buggy!
|
|
|
|
```tsx
|
|
import { Form, Input } from 'antd';
|
|
|
|
let acc = 0;
|
|
|
|
const Demo = () => {
|
|
const [form] = Form.useForm();
|
|
return (
|
|
<Form
|
|
form={form}
|
|
name="debug"
|
|
initialValues={{
|
|
debug1: 'debug1',
|
|
debug2: 'debug2',
|
|
}}
|
|
>
|
|
<Form.Item noStyle dependencies={['debug1']}>
|
|
{
|
|
() => acc++
|
|
// return <pre>{JSON.stringify(form.getFieldsValue(), null, 2)}</pre>;
|
|
}
|
|
</Form.Item>
|
|
<Form.Item label="debug1" name="debug1">
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item label="debug2" name="debug2">
|
|
<Input />
|
|
</Form.Item>
|
|
</Form>
|
|
);
|
|
};
|
|
|
|
export default () => <Demo />;
|
|
```
|