提交 6954c350 编写于 作者: L LeezQ 提交者: Wei Zhu

docs: add typescript demo (#7330)

* feat: add typescript demo

add form typescript demo code

* Update index.zh-CN.md

* add TypeScript demo code

add TypeScript demo code

* Update index.en-US.md

* Update index.zh-CN.md

* Update index.en-US.md
上级 a204c0af
......@@ -164,3 +164,20 @@ See more advanced usage at [async-validator](https://github.com/yiminghe/async-v
max-width: 540px;
}
</style>
## Using in TypeScript
```jsx
import { Form } from 'antd';
import { FormComponentProps } from 'antd/lib/form/Form';
interface UserFormProps extends FormComponentProps {
age: number;
name: string;
}
class UserForm extends React.Component<UserFormProps, any> {
}
......@@ -164,3 +164,19 @@ validator | 自定义校验(注意,[callback 必须被调用](https://github
max-width: 540px;
}
</style>
## 在 TypeScript 中使用
```jsx
import { Form } from 'antd';
import { FormComponentProps } from 'antd/lib/form/Form';
interface UserFormProps extends FormComponentProps {
age: number;
name: string;
}
class UserForm extends React.Component<UserFormProps, any> {
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册