
参数
| 参数 |
说明 |
类型 |
可选值 |
默认值 |
| title |
标题文字 |
string |
—— |
—— |
| text |
内容文字 |
string |
—— |
—— |
| button |
按钮文字 |
string |
—— |
确定 |
| onConfirm |
确定回调 |
function |
—— |
—— |
| close |
关闭弹框 |
boolean |
true |
—— |
使用示例
<template> <div> <button @click="showAlert">点击显示 Alert</button> </div></template><script>import Vue from "vue";import { Alert } from "genie-ui";Vue.use(Alert);export default { methods: { showAlert() { this.$alert({ text: "这里是alert的内容", title: "我是alert", button: "确定", onConfirm() { console.warn('我是confirm的callback!') } }); }, // 关闭弹框 closeAlert() { this.$alert({ close: true }) } }};</script>