element-plus/docs/examples/message-box/customized-icon.vue

21 lines
437 B
Vue
Raw Normal View History

<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>