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

1.0.1 • 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.1

License

ISC

Unpacked Size

12.7 kB

Total Files

11

Last publish

Collaborators

  • zhenkunliu2
  • xuliangmost
  • hanyefeng
  • lwwshare
  • remmurd1
  • runrunr
  • devmsg
  • hongweihu
  • iuwoo
  • ykboluo
  • yqg-owner
  • yulodl
  • center620
  • guxiaodai
  • northseacoder
  • zzj5470816
  • yyh_
  • szll
  • zhayoyang