Refactor #4211 - For Badge Directive
parent
f37a0a783e
commit
392f1476f0
|
@ -68,16 +68,27 @@ export interface BadgeContext {
|
|||
info: boolean;
|
||||
/**
|
||||
* Current success state as a boolean.
|
||||
* @defaultValue false
|
||||
*/
|
||||
success: boolean;
|
||||
/**
|
||||
* Current warning state as a boolean.
|
||||
* @defaultValue false
|
||||
*/
|
||||
warning: boolean;
|
||||
/**
|
||||
* Current danger state as a boolean.
|
||||
* @defaultValue false
|
||||
*/
|
||||
danger: boolean;
|
||||
/**
|
||||
* Current gutter state as a boolean.
|
||||
*/
|
||||
nogutter: boolean;
|
||||
/**
|
||||
* Current dot state as a boolean.
|
||||
*/
|
||||
dot: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,11 @@ const BadgeDirective = BaseBadgeDirective.extend('badge', {
|
|||
id,
|
||||
class: !el.unstyled && this.cx('root'),
|
||||
'p-bind': this.ptm('root', {
|
||||
context: binding.modifiers
|
||||
context: {
|
||||
...binding.modifiers,
|
||||
nogutter: String(binding.value).length === 1,
|
||||
dot: binding.value == null
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue