index.js 451 B

123456789101112131415161718192021222324252627
  1. // components/swiper/index.js
  2. var app = getApp();
  3. Component({
  4. properties: {
  5. imgUrls: {
  6. type: Object,
  7. value: []
  8. }
  9. },
  10. data: {
  11. circular: true,
  12. autoplay: true,
  13. interval: 3000,
  14. duration: 500,
  15. currentSwiper: 0
  16. },
  17. attached: function () {
  18. console.log(this.data.imgUrls);
  19. },
  20. methods: {
  21. swiperChange: function (e) {
  22. this.setData({
  23. currentSwiper: e.detail.current
  24. })
  25. },
  26. }
  27. })