greatjoy-swiper
v1.0.2
Published
A React modal component based on antd-mobile with enhanced features
Maintainers
Readme
GreatJoy Swiper
一个基于 antd-mobile 的增强型 React 模态框组件,支持组件式和指令式两种使用方式。
安装
npm install greatjoy-swiper antd-mobile引入样式
重要:必须引入样式文件才能正常显示!
// 在你的应用入口文件中引入样式
import "greatjoy-swiper/dist/index.css";使用方法
import GreatJoySwiper from "greatjoy-swiper";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
