mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
b3c423ff11
* feat: 🎸 [badge] add color prop add color prop to set badge background color * Update badge.md * 更新文档 * docs: ✏️ [badge] add color prop * Update docs/en-US/component/badge.md --------- Co-authored-by: btea <2356281422@qq.com>
51 lines
1.2 KiB
Vue
51 lines
1.2 KiB
Vue
<template>
|
|
<el-badge :value="12" class="item">
|
|
<el-button>comments</el-button>
|
|
</el-badge>
|
|
<el-badge :value="3" class="item">
|
|
<el-button>replies</el-button>
|
|
</el-badge>
|
|
<el-badge :value="1" class="item" type="primary">
|
|
<el-button>comments</el-button>
|
|
</el-badge>
|
|
<el-badge :value="2" class="item" type="warning">
|
|
<el-button>replies</el-button>
|
|
</el-badge>
|
|
<el-badge :value="1" class="item" color="green">
|
|
<el-button>custom background</el-button>
|
|
</el-badge>
|
|
<el-dropdown trigger="click">
|
|
<span class="el-dropdown-link">
|
|
Click Me
|
|
<el-icon class="el-icon--right"><caret-bottom /></el-icon>
|
|
</span>
|
|
<template #dropdown>
|
|
<el-dropdown-menu>
|
|
<el-dropdown-item class="clearfix">
|
|
comments
|
|
<el-badge class="mark" :value="12" />
|
|
</el-dropdown-item>
|
|
<el-dropdown-item class="clearfix">
|
|
replies
|
|
<el-badge class="mark" :value="3" />
|
|
</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</template>
|
|
</el-dropdown>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { CaretBottom } from '@element-plus/icons-vue'
|
|
</script>
|
|
|
|
<style scoped>
|
|
.item {
|
|
margin-top: 10px;
|
|
margin-right: 30px;
|
|
}
|
|
|
|
.el-dropdown {
|
|
margin-top: 1.1rem;
|
|
}
|
|
</style>
|