Badge.vue 2.0 KB

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