element-plus/docs/examples/message-box/alert.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

23 lines
542 B
Vue

<template>
<el-button plain @click="open">Click to open the Message Box</el-button>
</template>
<script lang="ts" setup>
import { ElMessage, ElMessageBox } from 'element-plus'
import type { Action } from 'element-plus'
const open = () => {
ElMessageBox.alert('This is a message', 'Title', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: 'OK',
callback: (action: Action) => {
ElMessage({
type: 'info',
message: `action: ${action}`,
})
},
})
}
</script>