mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
5d88f628bb
* feat(components): [message-box] add autofocus attribute * fix: autofocus to be true by default * docs: message-box autofocus default value * chore: remove useless comment * fix: focusStartRef value el
23 lines
541 B
Vue
23 lines
541 B
Vue
<template>
|
|
<el-button text @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>
|