当前位置: 首页 > 文档资料 > Pile.js 中文文档 >

Confirm 对话框

优质
小牛编辑
147浏览
2023-12-01

定义

模拟对话框。

图片展示

代码演示


import Dialog from 'pile/dist/components/dialog'
const  {Confirm} = Dialog
<Confirm
  show={true}
  type='fail'
  title='我喜欢pile'
  buttons={[
{
  label: '取消',
  onClick: function(){console.log("点击了取消按钮")}
},
{
  type: 'default',
  label: '确定',
  onClick: function(){console.log("点击了确定按钮")}
}
  ]}
/>

属性

参数描述数据类型默认值
show是否展示对话框boll
type类型,错误:warning,成功:successstringwarning
title弹层titlestring
buttons按钮数组array
buttons.label标签名称string
buttons.onClick点击事件function
buttons.type按钮样式string
MaskClick点击蒙板回调function