element-plus/docs/examples/message-box/confirm.vue
JeremyWuuuuu e97fe719c4
chore(docs): update text button type (#7533)
- Update button's type in examples per changes for button
2022-05-06 17:33:52 +08:00

32 lines
637 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'
const open = () => {
ElMessageBox.confirm(
'proxy will permanently delete the file. Continue?',
'Warning',
{
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
type: 'warning',
}
)
.then(() => {
ElMessage({
type: 'success',
message: 'Delete completed',
})
})
.catch(() => {
ElMessage({
type: 'info',
message: 'Delete canceled',
})
})
}
</script>