docs(components): [message-box] add customized icon for examples (#8381)

This commit is contained in:
LIUCHAO 2022-06-22 09:29:27 +08:00 committed by GitHub
parent 37ed7a15ee
commit 63847a981f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -95,6 +95,16 @@ message-box/centered-content
:::
## Customized Icon
The icon can be customized to any Vue component or [render function (JSX)](https://vuejs.org/guide/extras/render-function.html).
:::demo
message-box/customized-icon
:::
## Draggable
MessageBox can be draggable.

View File

@ -0,0 +1,20 @@
<template>
<el-button text @click="open">Click to open Message Box</el-button>
</template>
<script lang="ts" setup>
import { markRaw } from 'vue'
import { ElMessageBox } from 'element-plus'
import { Delete } from '@element-plus/icons-vue'
const open = () => {
ElMessageBox.confirm(
'It will permanently delete the file. Continue?',
'Warning',
{
type: 'warning',
icon: markRaw(Delete),
}
)
}
</script>