Fixed #1207 - Slot support for Badge component
parent
af4f9183a3
commit
81c0928fa0
|
@ -1,5 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<span :class="badgeClass">{{value}}</span>
|
<span :class="badgeClass">
|
||||||
|
<slot>{{value}}</slot>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -17,7 +19,7 @@ export default {
|
||||||
badgeClass() {
|
badgeClass() {
|
||||||
return ['p-badge p-component', {
|
return ['p-badge p-component', {
|
||||||
'p-badge-no-gutter': this.value && String(this.value).length === 1,
|
'p-badge-no-gutter': this.value && String(this.value).length === 1,
|
||||||
'p-badge-dot': !this.value,
|
'p-badge-dot': !this.value && !this.$slots.default,
|
||||||
'p-badge-lg': this.size === 'large',
|
'p-badge-lg': this.size === 'large',
|
||||||
'p-badge-xl': this.size === 'xlarge',
|
'p-badge-xl': this.size === 'xlarge',
|
||||||
'p-badge-info': this.severity === 'info',
|
'p-badge-info': this.severity === 'info',
|
||||||
|
|
Loading…
Reference in New Issue