GalleryList.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <!-- 基准的列表模块,通过不同的 type 展示不同的样式 -->
  4. <div class="flex w-full p-10px" :class="`complex-list__${type}`">
  5. <CustomGallery :class="`complex-list__gallery_${type}`" :type="complexTypeMap[type][0]" :gallery-config="galleryConfig" />
  6. <CustomList :class="`complex-list__list_${type}`" :type="complexTypeMap[type][1]" :list-config="listConfig" />
  7. </div>
  8. </template>
  9. <script lang="ts" setup>
  10. import CustomList from './CustomList.vue';
  11. import CustomGallery from './CustomGallery.vue';
  12. withDefaults(
  13. defineProps<{
  14. listConfig: {
  15. value: string;
  16. color: string;
  17. label: string;
  18. prop: string;
  19. info: string;
  20. }[];
  21. galleryConfig: {
  22. value: string;
  23. color: string;
  24. label: string;
  25. prop: string;
  26. }[];
  27. /** A B */
  28. type: string;
  29. }>(),
  30. {
  31. listConfig: () => [],
  32. galleryConfig: () => [],
  33. type: 'A',
  34. }
  35. );
  36. const complexTypeMap = {
  37. A: ['B', 'A'],
  38. B: ['C', 'A'],
  39. };
  40. // defineEmits(['click']);
  41. </script>
  42. <style lang="less" scoped>
  43. @import '@/design/theme.less';
  44. .complex-list__gallery_A {
  45. // width: 200px;
  46. flex-basis: 35%;
  47. height: 240px;
  48. // transform: scale(0.8);
  49. // might not work in Firefox
  50. zoom: 0.6;
  51. }
  52. .complex-list__list_A {
  53. flex-basis: 65%;
  54. }
  55. .complex-list__B {
  56. align-items: center;
  57. }
  58. .complex-list__gallery_B {
  59. height: 150px;
  60. // width: 200px;
  61. flex-basis: 35%;
  62. // transform: scale(0.8);
  63. // might not work in Firefox
  64. }
  65. .complex-list__list_B {
  66. flex-basis: 65%;
  67. }
  68. </style>