-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
/
badge.ts
47 lines (46 loc) 路 979 Bytes
/
badge.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { buildProps } from '@element-plus/utils'
import type { ExtractPropTypes } from 'vue'
export const badgeProps = buildProps({
/**
* @description display value.
*/
value: {
type: [String, Number],
default: '',
},
/**
* @description maximum value, shows `{max}+` when exceeded. Only works if value is a number.
*/
max: {
type: Number,
default: 99,
},
/**
* @description if a little dot is displayed.
*/
isDot: Boolean,
/**
* @description hidden badge.
*/
hidden: Boolean,
/**
* @description badge type.
*/
type: {
type: String,
values: ['primary', 'success', 'warning', 'info', 'danger'],
default: 'danger',
},
/**
* @description whether to show badge when value is zero.
*/
showZero: {
type: Boolean,
default: true,
},
/**
* @description background color of the Badge
*/
color: String,
} as const)
export type BadgeProps = ExtractPropTypes<typeof badgeProps>