greatjoy-modal
v1.0.9
Published
A React modal component based on antd-mobile with enhanced features
Maintainers
Readme
GreatJoy Modal
一个基于 antd-mobile 的增强型 React 模态框组件,支持组件式和指令式两种使用方式。
安装
npm install greatjoy-modal antd-mobile使用方法
import GreatJoyModal from "greatjoy-modal";API
组件式调用
|key|是否必填|类型|描述| |--|--|--|--| |content|否|string | React.ReactNode|模态框内容| |confirmText|否|string|确认按钮文本,默认为"确认",非 true 时不展示确认按钮| |cancelText|否|string|取消按钮文本,默认为"取消",非 true 时不展示取消按钮| |onConfirm|否|() => void|确认按钮点击回调函数| |onCancel|否|() => void|取消按钮点击回调函数| |otherProps|-|-|其他传递给Modal组件的属性|
其他参数详见 https://ant-design-mobile.antgroup.com/zh/components/modal#modal
指令式调用
|key|是否必填|类型|描述| |--|--|--|--| |icon|否|React.ReactNode|Icon图标参考:https://ant-design-mobile.antgroup.com/zh/components/icon| |confirmText|否|string|确认按钮文案,非 true 时不展示确认按钮| |cancelText|否|string|取消按钮文案,非 true 时不展示取消按钮| |onConfirm|否|() => Promise|点击确认事件,reslove 时,会自动关闭弹窗| |onCancel|否|() => void|点击取消事件|
其他参数详见 https://ant-design-mobile.antgroup.com/zh/components/modal#modalshow
