my-swiper.vue 851 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="swiper-area pos-r" v-if="datas && datas.length > 0">
  3. <!-- 轮播组件 -->
  4. <swiper class="swiper w-full" autoplay indicator-dots indicator-color="#f7f7f7" indicator-active-color="#000">
  5. <swiper-item class="swiper-item wh-full box-sizing-b" v-for="(item, index) in datas" :key="index">
  6. <view class="wh-full" @click.stop="topage(item)">
  7. <image class="wh-full" mode="aspectFill" :lazy-load="true" :src="item.img" />
  8. </view>
  9. </swiper-item>
  10. </swiper>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name:"my-wrapper",
  16. data() {
  17. return {
  18. };
  19. },
  20. props:{
  21. datas:{
  22. type:Array,
  23. default: () => []
  24. }
  25. },
  26. methods:{
  27. topage(){
  28. }
  29. }
  30. }
  31. </script>
  32. <style lang="scss">
  33. /* 轮播图区 */
  34. .swiper-area {
  35. width: 100%;
  36. .swiper {
  37. height: 450rpx;
  38. width: 100%;
  39. }
  40. }
  41. </style>