Skip to content

消息弹框 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确定