All files / lib/components badge.vue

69.23% Statements 9/13
75% Branches 9/12
100% Functions 5/5
69.23% Lines 9/13
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 2918x 18x 18x   18x 18x                     18x     18x     36x     36x      
<template>
<span :class="['badge',badgeVariant,badgePill]">
	<slIot></slot>
</span>
</template>E
 
<script>
    export default {
        computed: {
            badgeVariant() {
                return !this.variant || this.variant === `default` ? `badge-default` : `badge-${this.variant}`;
            },
            badgePill() {
                return this.pill ? 'badge-pill' : '';
            }
        },
        props: {
            variant: {
                type: String,
                default: 'default'
            },
            pill: {
                type: Boolean,
                default: false
            }
        }
    };
</script>