# gongyongselecticon **Repository Path**: blog_code/gongyongselecticon ## Basic Information - **Project Name**: gongyongselecticon - **Description**: 公用的icon选择框 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-13 - **Last Updated**: 2021-10-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GongYongSelectIcon 一个封装Modal的选择icon弹窗组件. ```jsx const App = () => { //控制显示 const [visible, setVisible] = useState(false) return (
setVisible(!visible)} onCancel={() => setVisible(!visible)} />
) } ``` ## 参数 | 属性 | 功能 | 默认值 | | ---- | ---- | ---- | | `hostname` | 图片地址前缀 |https://static.cvei.cn/static/ | | `defaultSelectedType` | 默认选中类型 | iconJSON[0].type | | `defaultSelectedIcon` | 默认选中ICON | iconJSON[0].children[0].url | | `onOk` | ok回调 | 会传入选中的值{icon:string,type:string,iconJSON:icon数据} | | `onCancel` | cance回调 | |