2019-10-06 18:03:21 +05:30
|
|
|
<template>
|
2019-10-11 15:25:50 +05:30
|
|
|
<div class="inline-block rounded px-2 py-1 truncate" :class="getColorClass">
|
2019-10-06 18:03:21 +05:30
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2019-10-11 15:25:50 +05:30
|
|
|
name: 'Badge',
|
|
|
|
props: {
|
|
|
|
color: {
|
|
|
|
default: 'gray'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
getColorClass() {
|
|
|
|
return {
|
|
|
|
gray: 'bg-gray-100 text-gray-600',
|
|
|
|
red: 'bg-red-100 text-red-600',
|
|
|
|
yellow: 'bg-yellow-100 text-yellow-600',
|
|
|
|
orange: 'bg-orange-100 text-orange-600',
|
2019-10-30 02:23:19 +05:30
|
|
|
blue: 'bg-blue-100 text-blue-600',
|
|
|
|
green: 'bg-green-100 text-green-600',
|
2019-10-11 15:25:50 +05:30
|
|
|
}[this.color];
|
|
|
|
}
|
|
|
|
}
|
2019-10-06 18:03:21 +05:30
|
|
|
};
|
|
|
|
</script>
|