Badge.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 :class="small ? 'small' : ''">{{ 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. small: {
  42. type: Boolean,
  43. required: false,
  44. defualt: false
  45. }
  46. })
  47. const expanded: Ref<boolean> = ref(false)
  48. const onHover = () => {
  49. }
  50. const onMoreClick = () => {
  51. }
  52. </script>
  53. <style scoped lang="scss">
  54. .v-card {
  55. height: 62px;
  56. width: 95%;
  57. padding: 10px;
  58. .frame {
  59. height: 42px;
  60. display: flex;
  61. flex-direction: row;
  62. justify-content: space-between;
  63. align-items: center;
  64. flex-wrap: nowrap;
  65. max-height: 100%;
  66. }
  67. .details {
  68. flex: 1;
  69. max-width: 154px;
  70. }
  71. .v-img {
  72. max-width: 24px;
  73. height: 24px;
  74. width: 24px;
  75. margin: 4px auto;
  76. }
  77. .v-card-title {
  78. font-size: 15px;
  79. padding: 0 16px;
  80. font-weight: 300;
  81. line-height: 18px;
  82. white-space: break-spaces;
  83. }
  84. .v-card-title.small {
  85. font-size: 14px;
  86. line-height: 16px;
  87. }
  88. .v-card-subtitle {
  89. font-size: 13px;
  90. }
  91. }
  92. .v-card-actions {
  93. width: 24px;
  94. right: 0;
  95. padding: 0 8px;
  96. .v-btn {
  97. width: 24px;
  98. font-size: 13px;
  99. color: rgb(var(--v-theme-primary));
  100. }
  101. }
  102. //.v-card-actions {
  103. // display: none;
  104. //}
  105. //
  106. //.v-card:hover {
  107. // .v-card-actions {
  108. // display: block;
  109. // }
  110. //}
  111. </style>