2018-12-26 22:34:29 +08:00
|
|
|
---
|
|
|
|
order: 11
|
|
|
|
title:
|
2019-05-07 14:57:32 +08:00
|
|
|
zh-CN: 带移除图标
|
|
|
|
en-US: With clear icon
|
2018-12-26 22:34:29 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
带移除图标的输入框,点击图标删除所有内容。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
2019-06-18 19:08:36 +08:00
|
|
|
Input box with the remove icon, click the icon to delete everything.
|
2018-12-26 22:34:29 +08:00
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2018-12-26 22:34:29 +08:00
|
|
|
import { Input } from 'antd';
|
|
|
|
|
2019-11-01 18:19:29 +08:00
|
|
|
const { TextArea } = Input;
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
const onChange = e => {
|
2018-12-26 22:34:29 +08:00
|
|
|
console.log(e);
|
|
|
|
};
|
|
|
|
|
|
|
|
ReactDOM.render(
|
2020-04-23 18:11:11 +08:00
|
|
|
<>
|
2019-11-01 18:19:29 +08:00
|
|
|
<Input placeholder="input with clear icon" allowClear onChange={onChange} />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<TextArea placeholder="textarea with clear icon" allowClear onChange={onChange} />
|
2020-04-23 18:11:11 +08:00
|
|
|
</>,
|
2019-05-07 14:57:32 +08:00
|
|
|
mountNode,
|
|
|
|
);
|
|
|
|
```
|