Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/en-US/component/message-box.md
Expand Up @@ -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.
Expand Down
20 changes: 20 additions & 0 deletions docs/examples/message-box/customized-icon.vue
@@ -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>