Commit c639474f authored by cinwell.li's avatar cinwell.li Committed by FuryBean

Badge: add hidden prop, close #2042 (#2050)

parent 47e75ad0
......@@ -135,3 +135,4 @@ Use a red dot to mark content that needs to be noticed.
| value | display value | string, number | — | — |
| max | maximum value, shows '{max}+' when exceeded. Only works if `value` is a `Number` | number | — | — |
| is-dot | if a little dot is displayed | boolean | — | false |
| hidden | hidden badge | boolean | - | false |
......@@ -137,3 +137,4 @@
| value | 显示值 | string, number | — | — |
| max | 最大值,超过最大值会显示 '{max}+',要求 value 是 Number 类型 | number | — | — |
| is-dot | 小圆点 | boolean | — | false |
| hidden | 隐藏 badge | boolean | - | false |
<template>
<div class="el-badge">
<slot></slot>
<transition name="el-zoom-in-center">
<sup
v-show="!hidden"
v-text="content"
class="el-badge__content"
:class="{ 'is-fixed': $slots.default, 'is-dot': isDot }">
</sup>
</transition>
</div>
</template>
......@@ -16,7 +19,8 @@ export default {
props: {
value: {},
max: Number,
isDot: Boolean
isDot: Boolean,
hidden: Boolean
},
computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment