element-plus/docs/examples/message-box/centered-content.vue
kooriookami ee7a21f670
feat(components): [message-box] MessageBox can drag overflow the viewport (#15674)
feat(components): [message-box] can drag overflow the viewport
2024-01-26 10:20:08 +08:00

33 lines
654 B
Vue

<template>
<el-button plain @click="open">Click to open Message Box</el-button>
</template>
<script lang="ts" setup>
import { ElMessage, ElMessageBox } from 'element-plus'
const open = () => {
ElMessageBox.confirm(
'proxy will permanently delete the file. Continue?',
'Warning',
{
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
type: 'warning',
center: true,
}
)
.then(() => {
ElMessage({
type: 'success',
message: 'Delete completed',
})
})
.catch(() => {
ElMessage({
type: 'info',
message: 'Delete canceled',
})
})
}
</script>