index.js 702 B

123456789101112131415161718192021222324252627282930
  1. define([
  2. 'swiper',
  3. 'text!./index.html',
  4. 'css!./index.css'
  5. ], function(Swiper, html) {
  6. return {
  7. props: {
  8. obj: {
  9. type: Object,
  10. default: function () {
  11. return {};
  12. }
  13. }
  14. },
  15. data: function () {
  16. return {
  17. swiperOptions: {
  18. slidesPerView: 'auto',
  19. spaceBetween: 10
  20. }
  21. };
  22. },
  23. mounted: function () {
  24. this.$nextTick(function () {
  25. this.swiper = new Swiper('#swiper6', this.swiperOptions);
  26. });
  27. },
  28. template: html
  29. };
  30. });