mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
docs(components): [message-box] add customized icon for examples (#8381)
This commit is contained in:
parent
37ed7a15ee
commit
63847a981f
@ -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
|
## Draggable
|
||||||
|
|
||||||
MessageBox can be draggable.
|
MessageBox can be draggable.
|
||||||
|
20
docs/examples/message-box/customized-icon.vue
Normal file
20
docs/examples/message-box/customized-icon.vue
Normal 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>
|
Loading…
Reference in New Issue
Block a user