ElementPlus的MessageBox自动关闭

<template>
  <el-row class="mb-4">
    <el-button @click="open" type="primary" show-confirm-button="false">Click</el-button>
  </el-row>
</template>
<script setup>
import { ElMessageBox } from 'element-plus'
const open = () => {
  ElMessageBox.confirm('提示内容', '提示', {
    type: 'warning',
    showCancelButton: false,
    showConfirmButton: false,
    showClose: false,
  })
  setTimeout(() => {
    ElMessageBox.close(false)
  }, 1500);
}
</script>
posted @ 2022-10-12 20:41  ☆のLueng☆  阅读(773)  评论(0编辑  收藏  举报