mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
fix: 修改 demo
This commit is contained in:
parent
a6617c9763
commit
434ef1fd7c
@ -1,7 +1,7 @@
|
||||
## zh-CN
|
||||
|
||||
清除已选择的颜色。可以使用受控 open 和 onClear 控制清除时关闭弹窗。
|
||||
清除已选择的颜色。
|
||||
|
||||
## en-US
|
||||
|
||||
Clear Color. You can use the controlled open and onClear controls to close popovers when clearing.
|
||||
Clear Color.
|
||||
|
@ -1,16 +1,4 @@
|
||||
import { ColorPicker } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
|
||||
export default () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
return (
|
||||
<ColorPicker
|
||||
open={open}
|
||||
allowClear
|
||||
onOpenChange={setOpen}
|
||||
onClear={() => {
|
||||
setOpen(false);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default () => <ColorPicker allowClear />;
|
||||
|
Loading…
Reference in New Issue
Block a user