注意:以下文档只适用于TOP接口,请谨慎使用!
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| title | 标题文字 | string | —— | —— |
| text | 内容文字 | string | —— | —— |
| confirmTxt | 确定按钮文字 | string | —— | 确定 |
| cancelTxt | 取消按钮文字 | string | —— | 取消 |
| onConfirm | 确定回调 | function | —— | —— |
| onCancel | 取消回调 | function | —— | —— |
<template>
<div>
<button @click="showConfirm">点击显示 Confirm</button>
</div>
</template>
<script>
import Vue from "vue";
import { Confirm } from "genie-ui";
Vue.use(Confirm);
export default {
methods: {
showConfirm() {
this.$confirm({
text: "这里是confirm的内容",
title: "我是confirm",
confirmTxt: "我是确定",
cancelTxt: "我是取消",
onConfirm() {
console.warn("我是confirm的callback!");
},
onCancel() {
console.warn("我是cancel的callback!");
}
});
}
}
};
</script>