Files
element-plus/docs/examples/alert/icon.vue
xinconan 25f42aa9d7 feat(components): [alert] add icon slot (#20034)
* feat(components): [alert]add icon slot

* refactor(components): [alert] move default iconComponent into icon slot

* chore: update version

---------

Co-authored-by: sea <45450994+warmthsea@users.noreply.github.com>
2025-03-09 15:34:11 +00:00

27 lines
641 B
Vue

<template>
<div style="max-width: 600px">
<el-alert title="Success alert" type="success" show-icon />
<el-alert title="Info alert" type="info" show-icon />
<el-alert title="Warning alert" type="warning" show-icon />
<el-alert title="Error alert" type="error" show-icon />
<el-alert title="Error alert with custom icon" type="error" show-icon>
<template #icon>
<Bell />
</template>
</el-alert>
</div>
</template>
<script lang="ts" setup>
import { Bell } from '@element-plus/icons-vue'
</script>
<style scoped>
.el-alert {
margin: 20px 0 0;
}
.el-alert:first-child {
margin: 0;
}
</style>