linxianxi
2 years ago
7 changed files with 36 additions and 31 deletions
@ -1,7 +1,7 @@ |
|||
## zh-CN |
|||
|
|||
清除已选择的颜色。 |
|||
清除已选择的颜色。可以使用受控 open 和 onClear 控制清除时关闭弹窗。 |
|||
|
|||
## en-US |
|||
|
|||
Clear Color. |
|||
Clear Color. You can use the controlled open and onClear controls to close popovers when clearing. |
|||
|
@ -1,4 +1,16 @@ |
|||
import { ColorPicker } from 'antd'; |
|||
import React from 'react'; |
|||
import React, { useState } from 'react'; |
|||
|
|||
export default () => <ColorPicker allowClear />; |
|||
export default () => { |
|||
const [open, setOpen] = useState(false); |
|||
return ( |
|||
<ColorPicker |
|||
open={open} |
|||
allowClear |
|||
onOpenChange={setOpen} |
|||
onClear={() => { |
|||
setOpen(false); |
|||
}} |
|||
/> |
|||
); |
|||
}; |
|||
|
Loading…
Reference in new issue