Skip to content
On this page

确认框 modal

基础使用(引入组件使用)

函数式使用

API

参数说明类型默认值
--部分ant design modal组件的props----
content内容string |VNode
contentStyle内容样式Object{}
title标题stringnull
参数说明类型默认值
--部分ant design modal组件的props----
content内容string |VNode
contentStyle内容样式Object{}
onCancel关闭回掉函数(params) => Promisenull
onOk确认回掉函数(params) => Promisenull
title标题stringnull

事件

事件名称说明回调参数
ok点击确定回调() => void
cancel点击遮罩层或右上角叉或取消按钮的回调() => void

以上函数调用后,会返回一个引用,可以通过该引用更新和关闭弹窗。

js

const modal = PlModal.info();

modal.update({
  title: '修改的标题',
  content: '修改的内容',
});

modal.destroy();

Released under the MIT License.