TheCard.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <script setup lang="ts">
  2. defineProps<{
  3. title: string
  4. description: string
  5. completed: boolean
  6. }>()
  7. const self = $shallowRef<HTMLElement>()
  8. defineExpose({
  9. getDom: () => self,
  10. })
  11. </script>
  12. <template>
  13. <div
  14. ref="self" class="min-h-100px w-250px flex overflow-hidden rounded"
  15. :class="completed ? 'bg-hex-d5dfff' : 'bg-hex-f2f2f2'"
  16. >
  17. <div class="w-175px flex flex-col px-14px py-14px">
  18. <div>{{ title }}</div>
  19. <div class="text-xs text-hex-6c6c6c">
  20. {{ description }}
  21. </div>
  22. <slot name="tip" />
  23. </div>
  24. <!-- -->
  25. <div
  26. class="w-75px flex flex-col items-center justify-center py-4 space-y-2"
  27. :class="completed ? 'bg-hex-003eee text-hex-003eee' : 'bg-hex-a3a3a3 text-hex-a3a3a3'"
  28. >
  29. <div class="h-42px w-42px border-3 border-white rounded-full border-dashed text-white">
  30. <i:mdi:tick v-if="completed" class="h-full w-full" />
  31. <i:mdi:horizontal-line v-else class="h-full w-full" />
  32. </div>
  33. <slot name="operate">
  34. <!-- <div class="min-w-60px cursor-pointer rounded bg-light-50 py-3px text-center text-xs">
  35. {{ completed ? '已经完成' : '立即开始' }}
  36. </div> -->
  37. </slot>
  38. </div>
  39. </div>
  40. </template>