swiper.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* uniapp-swiper混入对象 */
  2. export default {
  3. props: {
  4. indicatorDots: {
  5. type: Boolean,
  6. default: false
  7. },
  8. indicatorColor: {
  9. type: String,
  10. default: 'rgba(0, 0, 0, .3)'
  11. },
  12. indicatorActiveColor: {
  13. type: String,
  14. default: '#000000'
  15. },
  16. autoplay: {
  17. type: Boolean,
  18. default: true
  19. },
  20. current: {
  21. type: Number,
  22. default: 0
  23. },
  24. interval: {
  25. type: Number,
  26. default: 5000
  27. },
  28. duration: {
  29. type: Number,
  30. default: 500
  31. },
  32. circular: {
  33. type: Boolean,
  34. default: false
  35. },
  36. vertical: {
  37. type: Boolean,
  38. default: false
  39. },
  40. previousMargin: {
  41. type: String,
  42. default: '0px'
  43. },
  44. nextMargin: {
  45. type: String,
  46. default: '0px'
  47. },
  48. skipHiddenItemLayout: {
  49. type: Boolean,
  50. default: false
  51. },
  52. easingFunction: {
  53. type: String,
  54. default: 'default',
  55. validator: value => ['default', 'linear', 'easeInCubic', 'easeOutCubic', 'easeInOutCubic'].indexOf(value
  56. .toString()) > -1
  57. }
  58. },
  59. methods:{
  60. onChange(event) {
  61. this.$emit('change', event.detail)
  62. },
  63. onTransition(event) {
  64. this.$emit('transition', event.detail)
  65. },
  66. onAnimationfinish(event) {
  67. this.$emit('animationfinish', event.detail)
  68. }
  69. }
  70. }