StoreStackSkeleton.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="store-stack-skeleton">
  3. <div v-for="n in count" :key="n" class="store-stack-skeleton__item">
  4. <a-skeleton-shape size="small" />
  5. <div class="store-stack-skeleton__content">
  6. <a-skeleton-line :widths="headerWidths" :rows="1" />
  7. <a-skeleton-line :widths="['100%', '70%']" :rows="2" />
  8. <a-skeleton-line v-if="showMeta" :widths="['28%', '32%', '24%']" :rows="1" />
  9. </div>
  10. <a-skeleton-line v-if="showAction" :widths="['72px']" :rows="1" class="store-stack-skeleton__action" />
  11. </div>
  12. </div>
  13. </template>
  14. <script setup>
  15. defineProps({
  16. count: { type: Number, default: 4 },
  17. showMeta: { type: Boolean, default: true },
  18. showAction: { type: Boolean, default: true },
  19. headerWidths: {
  20. type: Array,
  21. default: () => ['35%', '55%']
  22. }
  23. })
  24. </script>
  25. <style scoped lang="less">
  26. @import '@/styles/store-theme.less';
  27. .store-stack-skeleton {
  28. display: flex;
  29. flex-direction: column;
  30. gap: 12px;
  31. width: 100%;
  32. &__item {
  33. display: flex;
  34. flex-wrap: wrap;
  35. align-items: flex-start;
  36. gap: 16px;
  37. padding: 16px 20px;
  38. background: @store-card-bg;
  39. border: 1px solid @store-card-border;
  40. border-radius: @store-radius;
  41. }
  42. &__content {
  43. flex: 1 1 200px;
  44. min-width: 0;
  45. display: flex;
  46. flex-direction: column;
  47. gap: 8px;
  48. }
  49. &__action {
  50. flex-shrink: 0;
  51. align-self: center;
  52. }
  53. }
  54. </style>