Appearance
消息弹框 MessageBox
模拟系统的消息提示框而实现的一套模态对话框组件,用于消息提示、确认消息和提交内容。
示例代码
<script setup lang="ts">
import { ESButton, messageBox } from "earthsdk-ui";
const handleDelete = () => {
messageBox({
title: "提示",
text: "您确认要删除吗?",
cancelButtonText: "取消",
confirmButtonText: "确定",
showCancelButton: true,
showIcon: true,
})
.then(() => {
console.log("确认");
})
.catch((err) => {
console.log("取消");
console.log(err);
});
};
</script>
<template>
<BlockBox text="窗口测试">
<ESButton @click="handleDelete()">弹出</ESButton>
</BlockBox>
</template>
<style scoped></style>
Attributes
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| title | 标题 | string | 提示 |
| text | 提示文字 | string | 确定要删除视角吗? |
| cancelButtonText | 左侧按钮文本 | string | 取消 |
| confirmButtonText | 右侧按钮文本 | string | 确定 |
EarthSDK UI