🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@yqg/react

Package Overview
Dependencies
Maintainers
15
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yqg/react

react based components

latest
npmnpm
Version
1.0.1
Version published
Maintainers
15
Created
Source

antd based react components & hooks

Modal

ModalContext

PropertyDescriptionTypeDefault Value
commonDialogPropsdefault及ModalProvider上设置的Modal Props, 方便使用openModalObject{width: 768, maskClosable: false, footer: null, style: {overflowX: 'hidden', overflowY: 'auto'}}
open用来open没有被业务代码用Modal包裹的组件Function-
openModal用来open被业务代码用Modal包裹的组件Function-
clearAll路由跳转等情况下清空modalFunction-

ModalProvider

PropertyDescriptionTypeDefault Value
dialogPropsModal Props,详见antd ModalObject-
<ModalProvider dialogProps={xxx}>
    {children}
</ModalProvider>

useModal

Options 部分参数仅open支持, 因为openModal拿到的是ModalWrappedComp, 不方便定制Modal

PropertyDescriptionTypeDefault Value
dialogPropsModal Props,详见antd ModalObject-
onlyClose只展示关闭按钮, 目前仅open支持boolean-
closeText关闭按钮文案, 目前仅open支持ReactNode关闭
const {commonDialogProps, open, openModal, clearAll} = useModal();
open(CompA, compProps, options).then(xxx);
openModal(ModalWrappedB, compProps, options).then(xxx);
clearAll();

Keywords

antd

FAQs

Package last updated on 14 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts