Appearance
确认框 modal
基础使用(引入组件使用)
函数式使用
API
modal(基础使用)
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
-- | 部分ant design modal组件的props | -- | -- |
content | 内容 | string |VNode | 无 |
contentStyle | 内容样式 | Object | {} |
title | 标题 | string | null |
modal.info
(函数式使用)
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
-- | 部分ant design modal组件的props | -- | -- |
content | 内容 | string |VNode | 无 |
contentStyle | 内容样式 | Object | {} |
onCancel | 关闭回掉函数 | (params) => Promise | null |
onOk | 确认回掉函数 | (params) => Promise | null |
title | 标题 | string | null |
事件
事件名称 | 说明 | 回调参数 |
---|---|---|
ok | 点击确定回调 | () => void |
cancel | 点击遮罩层或右上角叉或取消按钮的回调 | () => void |
以上函数调用后,会返回一个引用,可以通过该引用更新和关闭弹窗。
js
const modal = PlModal.info();
modal.update({
title: '修改的标题',
content: '修改的内容',
});
modal.destroy();