db-tag.vue 834 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <text class="db-tag" :class="'db-tag--' + type">
  3. <slot />
  4. </text>
  5. </template>
  6. <script setup>
  7. defineProps({
  8. type: { type: String, default: 'default' }
  9. })
  10. </script>
  11. <style scoped>
  12. .db-tag {
  13. display: inline-block;
  14. padding: 2px 8px;
  15. border-radius: 4px;
  16. font-size: 12px;
  17. line-height: 1.4;
  18. border: 1px solid transparent;
  19. }
  20. .db-tag--default {
  21. color: #323233;
  22. background: #f2f3f5;
  23. }
  24. .db-tag--primary {
  25. color: #52b788;
  26. background: rgba(82, 183, 136, 0.12);
  27. border-color: #52b788;
  28. }
  29. .db-tag--success {
  30. color: #07c160;
  31. background: rgba(7, 193, 96, 0.1);
  32. border-color: #07c160;
  33. }
  34. .db-tag--warning {
  35. color: #ff976a;
  36. background: rgba(255, 151, 106, 0.12);
  37. border-color: #ff976a;
  38. }
  39. .db-tag--danger {
  40. color: #ee0a24;
  41. background: rgba(238, 10, 36, 0.1);
  42. border-color: #ee0a24;
  43. }
  44. </style>