diff --git a/packages/arco-lib/src/components/Modal.tsx b/packages/arco-lib/src/components/Modal.tsx index c882c4a4..e666d018 100644 --- a/packages/arco-lib/src/components/Modal.tsx +++ b/packages/arco-lib/src/components/Modal.tsx @@ -20,6 +20,7 @@ const exampleProperties: Static = { confirmLoading: false, defaultOpen: true, unmountOnExit: true, + hideFooter: false, }; export const Modal = implementRuntimeComponent({ version: 'arco/v1', @@ -48,7 +49,7 @@ export const Modal = implementRuntimeComponent({ }, })(props => { const { getElement, subscribeMethods, slotsElements, customStyle, callbackMap } = props; - const { title, defaultOpen, ...cProps } = getComponentProps(props); + const { title, defaultOpen, hideFooter, ...cProps } = getComponentProps(props); const [visible, setVisible] = useState(defaultOpen); const contentRef = useRef(null); @@ -90,7 +91,7 @@ export const Modal = implementRuntimeComponent({ }} afterClose={afterClose} afterOpen={afterOpen} - footer={slotsElements.footer ? slotsElements.footer({}) : undefined} + footer={hideFooter ? null : slotsElements?.footer?.({})} className={css(customStyle?.content)} mountOnEnter={true} {...cProps} diff --git a/packages/arco-lib/src/generated/types/Modal.ts b/packages/arco-lib/src/generated/types/Modal.ts index c54fb823..e6d808dc 100644 --- a/packages/arco-lib/src/generated/types/Modal.ts +++ b/packages/arco-lib/src/generated/types/Modal.ts @@ -46,4 +46,8 @@ export const ModalPropsSpec = { title: 'Destroy On Hide', category: Category.Behavior, }), + hideFooter: Type.Boolean({ + title: 'Hide Footer', + category: Category.Behavior, + }), };