mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 03:08:21 +08:00
ee7a21f670
feat(components): [message-box] can drag overflow the viewport
62 lines
1.2 KiB
Vue
62 lines
1.2 KiB
Vue
<template>
|
|
<el-button plain @click="open">Open a draggable Message Box</el-button>
|
|
<el-button plain @click="open2">
|
|
Open a overflow draggable 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',
|
|
draggable: true,
|
|
}
|
|
)
|
|
.then(() => {
|
|
ElMessage({
|
|
type: 'success',
|
|
message: 'Delete completed',
|
|
})
|
|
})
|
|
.catch(() => {
|
|
ElMessage({
|
|
type: 'info',
|
|
message: 'Delete canceled',
|
|
})
|
|
})
|
|
}
|
|
|
|
const open2 = () => {
|
|
ElMessageBox.confirm(
|
|
'proxy will permanently delete the file. Continue?',
|
|
'Warning',
|
|
{
|
|
confirmButtonText: 'OK',
|
|
cancelButtonText: 'Cancel',
|
|
type: 'warning',
|
|
draggable: true,
|
|
overflow: true,
|
|
}
|
|
)
|
|
.then(() => {
|
|
ElMessage({
|
|
type: 'success',
|
|
message: 'Delete completed',
|
|
})
|
|
})
|
|
.catch(() => {
|
|
ElMessage({
|
|
type: 'info',
|
|
message: 'Delete canceled',
|
|
})
|
|
})
|
|
}
|
|
</script>
|