Badge.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <v-card @hover="onHover">
  3. <div class="frame">
  4. <v-img
  5. :src="img"
  6. :alt="title"
  7. :width="24"
  8. />
  9. <div class="details">
  10. <v-card-title>{{ title }}</v-card-title>
  11. <v-card-subtitle v-if="subtitle">{{ subtitle }}</v-card-subtitle>
  12. </div>
  13. <!-- <v-card-text v-if="details && expanded">{{ details }}</v-card-text>-->
  14. <!-- <v-card-actions v-if="details && !expanded">-->
  15. <!-- <v-btn icon="fas fa-plus" variant="flat" @click="onMoreClick" />-->
  16. <!-- </v-card-actions>-->
  17. <v-card-actions>
  18. <v-btn v-if="false" icon="fas fa-plus" variant="flat" @click="onMoreClick" />
  19. </v-card-actions>
  20. </div>
  21. </v-card>
  22. </template>
  23. <script setup lang="ts">
  24. import type { PropType } from '@vue/runtime-core'
  25. import type { Ref } from '@vue/reactivity'
  26. defineProps({
  27. title: {
  28. type: String,
  29. required: true
  30. },
  31. img: {
  32. type: String,
  33. required: true
  34. },
  35. subtitle: {
  36. type: String as PropType<string | null>,
  37. required: false,
  38. default: null
  39. },
  40. details: {
  41. type: String as PropType<string | null>,
  42. required: false,
  43. default: null
  44. },
  45. })
  46. const expanded: Ref<boolean> = ref(false)
  47. const onHover = () => {
  48. }
  49. const onMoreClick = () => {
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. .v-card {
  54. height: 54px;
  55. width: 95%;
  56. padding: 10px;
  57. .frame {
  58. display: flex;
  59. flex-direction: row;
  60. justify-content: space-between;
  61. align-items: center;
  62. flex-wrap: nowrap;
  63. max-height: 100%;
  64. }
  65. .details {
  66. flex: 1;
  67. max-width: 154px;
  68. }
  69. .v-img {
  70. max-width: 24px;
  71. height: 24px;
  72. width: 24px;
  73. margin: 4px;
  74. }
  75. .v-card-title {
  76. font-size: 15px;
  77. padding: 0 16px;
  78. font-weight: 300;
  79. text-overflow: ellipsis;
  80. }
  81. .v-card-subtitle {
  82. font-size: 13px;
  83. }
  84. }
  85. .v-card-actions {
  86. width: 24px;
  87. right: 0;
  88. padding: 0 8px;
  89. .v-btn {
  90. width: 24px;
  91. font-size: 13px;
  92. color: rgb(var(--v-theme-primary-alt));
  93. }
  94. }
  95. //.v-card-actions {
  96. // display: none;
  97. //}
  98. //
  99. //.v-card:hover {
  100. // .v-card-actions {
  101. // display: block;
  102. // }
  103. //}
  104. </style>