StoreGridSkeleton.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="store-grid-skeleton" :style="gridStyle">
  3. <article v-for="n in count" :key="n" class="store-grid-skeleton__card">
  4. <div class="store-grid-skeleton__visual">
  5. <a-skeleton-shape size="large" />
  6. </div>
  7. <div class="store-grid-skeleton__body">
  8. <a-skeleton-line :widths="['75%']" :rows="1" />
  9. <a-skeleton-line :widths="['100%', '90%']" :rows="2" />
  10. <a-skeleton-line :widths="['40%', '35%']" :rows="1" />
  11. </div>
  12. </article>
  13. </div>
  14. </template>
  15. <script setup>
  16. import { computed } from 'vue'
  17. const props = defineProps({
  18. count: { type: Number, default: 6 },
  19. minWidth: { type: String, default: '280px' }
  20. })
  21. const gridStyle = computed(() => ({
  22. gridTemplateColumns: `repeat(auto-fill, minmax(min(100%, ${props.minWidth}), 1fr))`
  23. }))
  24. </script>
  25. <style scoped lang="less">
  26. @import '@/styles/store-theme.less';
  27. .store-grid-skeleton {
  28. display: grid;
  29. gap: 16px;
  30. width: 100%;
  31. &__card {
  32. background: @store-card-bg;
  33. border: 1px solid @store-card-border;
  34. border-radius: @store-radius;
  35. overflow: hidden;
  36. }
  37. &__visual {
  38. display: flex;
  39. align-items: center;
  40. justify-content: center;
  41. min-height: 120px;
  42. background: fade(@store-accent, 8%);
  43. border-bottom: 1px solid @store-card-border;
  44. }
  45. &__body {
  46. padding: 16px;
  47. display: flex;
  48. flex-direction: column;
  49. gap: 10px;
  50. }
  51. }
  52. </style>