Skip to content

Commit

Permalink
Fixed #4863 - Button: new badgeSeverity property
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Nov 22, 2023
1 parent f12576c commit 70efc14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions components/lib/button/BaseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export default {
type: String,
default: null
},
badgeSeverity: {
type: String,
default: null
},
loading: {
type: Boolean,
default: false
Expand Down
4 changes: 4 additions & 0 deletions components/lib/button/Button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ export interface ButtonProps extends ButtonHTMLAttributes {
* Style class of the badge.
*/
badgeClass?: string | undefined;
/**
* Severity type of the badge.
*/
badgeSeverity?: 'info' | 'success' | 'warning' | 'danger' | string | null | undefined;
/**
* Whether the button is in loading state.
* @defaultValue false
Expand Down
2 changes: 1 addition & 1 deletion components/lib/button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<span v-if="icon" :class="[cx('icon'), icon, iconClass]" v-bind="ptm('icon')"></span>
</slot>
<span :class="cx('label')" v-bind="ptm('label')">{{ label || '&nbsp;' }}</span>
<Badge v-if="badge" :value="badge" :class="badgeClass" :unstyled="unstyled" v-bind="ptm('badge')"></Badge>
<Badge v-if="badge" :value="badge" :class="badgeClass" :severity="badgeSeverity" :unstyled="unstyled" v-bind="ptm('badge')"></Badge>
</slot>
</button>
</template>
Expand Down

0 comments on commit 70efc14

Please sign in to comment.