s-image-banner.vue 752 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <su-swiper
  3. :list="imgList"
  4. :dotStyle="dotMap[data.indicator]"
  5. imageMode="widthFix"
  6. dotCur="bg-mask-40"
  7. :seizeHeight="300"
  8. :autoplay="data.autoplay"
  9. :interval="Number(data.interval)"
  10. />
  11. </template>
  12. <script setup>
  13. import { computed } from 'vue';
  14. import sheep from '@/sheep';
  15. const dotMap = {
  16. 1: 'long',
  17. 2: 'tag',
  18. };
  19. const props = defineProps({
  20. data: {
  21. type: Object,
  22. default: () => ({}),
  23. },
  24. styles: {
  25. type: Object,
  26. default: () => ({}),
  27. },
  28. });
  29. const imgList = computed(() =>
  30. props.data.list.map((item) => ({
  31. ...item,
  32. src: sheep.$url.cdn(item.src),
  33. poster: sheep.$url.cdn(item.poster),
  34. })),
  35. );
  36. </script>
  37. <style></style>