screenTextScroll.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="_notice">
  3. <swiper class="_swiper tc" @change="slideChange" indicator-dots="false" autoplay="true" circular="true"
  4. display-multiple-items="2" :duration="duration" :interval="interval">
  5. <swiper-item>
  6. <view class="swiper-item uni-bg-red"></view>
  7. </swiper-item>
  8. <swiper-item>
  9. <view class="swiper-item uni-bg-red"></view>
  10. </swiper-item>
  11. <swiper-item v-for="(item,index) in list" :key="index">
  12. <view class="swiper-item uni-bg-red">{{item}}</view>
  13. </swiper-item>
  14. </swiper>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. props: {
  20. //显示数据
  21. list: {
  22. type: Array,
  23. defual:function(){
  24. return [];
  25. }
  26. },
  27. },
  28. data() {
  29. return {
  30. interval:3000,
  31. duration:12000,
  32. };
  33. },
  34. methods:{
  35. slideChange(e){
  36. this.$emit('getCurrentIndex',e.detail.current);
  37. }
  38. }
  39. };
  40. </script>
  41. <style>
  42. ._notice {
  43. width: 100%;
  44. font-size: 25rpx;
  45. color: #ffffff;
  46. border-radius: 6rpx;
  47. overflow: hidden;
  48. box-sizing: border-box;
  49. height: 45upx;
  50. }
  51. ._swiper {
  52. line-height: 47upx;
  53. }
  54. </style>