<script> import { Dialog } from 'src/index'; export default { methods: { handleAlertClick() { Dialog.alert({ title: 'alert标题', message: '弹窗提示文字,左右始终距离边20PX,上下距离20PX,文字左对齐。弹窗提示文字,左右始终距离边20PX,上下距离20PX,文字左对齐。' }).then((action) => { console.log(action); }); }, handleConfirmClick() { Dialog.confirm({ title: 'confirm标题', message: '弹窗提示文字,左右始终距离边20PX,上下距离20PX,文字左对齐。弹窗提示文字,左右始终距离边20PX,上下距离20PX,文字左对齐。' }).then((action) => { console.log(action); }, (error) => { console.log(error); }); } } }; </script> ## Dialog组件 ### 基础用法 :::demo ```html <z-button @click="handleAlertClick">alert</z-button> <z-button @click="handleConfirmClick">confirm</z-button> ``` ::: ### API | 参数 | 说明 | 类型 | 默认值 | 可选值 | |-----------|-----------|-----------|-------------|-------------| | title | 标题 | String | '' | | | message | 内容 | String | '' | |