diff --git a/packages/app/src/components/fields/icons/index.tsx b/packages/app/src/components/fields/icons/index.tsx index af2b69e9d..d41780c5c 100644 --- a/packages/app/src/components/fields/icons/index.tsx +++ b/packages/app/src/components/fields/icons/index.tsx @@ -1,42 +1,48 @@ import React, { useState } from 'react'; import { connect } from '@formily/react-schema-renderer'; -import { Popover, Button } from 'antd'; +import { Popover, Button, Input } from 'antd'; import { acceptEnum, mapStyledProps, mapTextComponent } from '../shared'; import { icons, hasIcon, Icon as IconComponent } from '@/components/icons'; +import { CloseOutlined } from '@ant-design/icons'; function IconField(props: any) { const { value, onChange } = props; const [visible, setVisible] = useState(false); return (
- { - setVisible(val); - }} - content={ -
- {[...icons.keys()].map(key => ( - { - onChange(key); - setVisible(false); - }} - > - - - ))} -
- } - title="图标" - trigger="click" - > - -
+ + { + setVisible(val); + }} + content={ +
+ {[...icons.keys()].map(key => ( + { + onChange(key); + setVisible(false); + }} + > + + + ))} +
+ } + title="图标" + trigger="click" + > + +
+ {value && } +
); }