mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
33 lines
663 B
Vue
33 lines
663 B
Vue
|
<template>
|
||
|
<el-button type="text" @click="open">Click to open Message Box</el-button>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts" setup>
|
||
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
||
|
|
||
|
const open = () => {
|
||
|
ElMessageBox.confirm(
|
||
|
'proxy will permanently delete the file. Continue?',
|
||
|
'Warning',
|
||
|
{
|
||
|
confirmButtonText: 'OK',
|
||
|
cancelButtonText: 'Cancel',
|
||
|
type: 'warning',
|
||
|
draggable: true,
|
||
|
}
|
||
|
)
|
||
|
.then(() => {
|
||
|
ElMessage({
|
||
|
type: 'success',
|
||
|
message: 'Delete completed',
|
||
|
})
|
||
|
})
|
||
|
.catch(() => {
|
||
|
ElMessage({
|
||
|
type: 'info',
|
||
|
message: 'Delete canceled',
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
</script>
|