@yqg/react
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

antd based react components & hooks

Modal

ModalContext

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

ModalProvider

Property Description Type Default Value
dialogProps Modal Props,详见antd Modal Object -
<ModalProvider dialogProps={xxx}>
    {children}
</ModalProvider>

useModal

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

Property Description Type Default Value
dialogProps Modal Props,详见antd Modal Object -
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();

Readme

Keywords

Package Sidebar

Install

npm i @yqg/react

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

346 kB

Total Files

161

Last publish

Collaborators

  • devmsg
  • hongweihu
  • iuwoo
  • ykboluo
  • yqg-owner
  • jxlnljt
  • yulodl
  • center620
  • zhchy
  • guxiaodai
  • northseacoder
  • wenxiujiang
  • zzj5470816
  • lixiaoxue
  • yyh_
  • szll
  • zhayoyang