props.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. export default {
  2. props: {
  3. radius: {
  4. type: String,
  5. default: 'none'
  6. },
  7. type: {
  8. type: String,
  9. default: 'img'
  10. },
  11. defList: {
  12. type: Array,
  13. default: []
  14. },
  15. // 列表数组,元素可为字符串,如为对象可通过keyName指定目标属性名
  16. list: {
  17. type: Array,
  18. default: uni.$u.props.swiper.list
  19. },
  20. // 是否显示面板指示器
  21. indicator: {
  22. type: Boolean,
  23. default: uni.$u.props.swiper.indicator
  24. },
  25. // 指示器非激活颜色
  26. indicatorActiveColor: {
  27. type: String,
  28. default: uni.$u.props.swiper.indicatorActiveColor
  29. },
  30. // 指示器的激活颜色
  31. indicatorInactiveColor: {
  32. type: String,
  33. default: uni.$u.props.swiper.indicatorInactiveColor
  34. },
  35. // 指示器样式,可通过bottom,left,right进行定位
  36. indicatorStyle: {
  37. type: [String, Object],
  38. default: uni.$u.props.swiper.indicatorStyle
  39. },
  40. // 指示器模式,line-线型,dot-点型
  41. indicatorMode: {
  42. type: String,
  43. default: uni.$u.props.swiper.indicatorMode
  44. },
  45. // 是否自动切换
  46. autoplay: {
  47. type: Boolean,
  48. default: uni.$u.props.swiper.autoplay
  49. },
  50. // 当前所在滑块的 index
  51. current: {
  52. type: [String, Number],
  53. default: uni.$u.props.swiper.current
  54. },
  55. // 当前所在滑块的 item-id ,不能与 current 被同时指定
  56. currentItemId: {
  57. type: String,
  58. default: uni.$u.props.swiper.currentItemId
  59. },
  60. // 滑块自动切换时间间隔
  61. interval: {
  62. type: [String, Number],
  63. default: uni.$u.props.swiper.interval
  64. },
  65. // 滑块切换过程所需时间
  66. duration: {
  67. type: [String, Number],
  68. default: uni.$u.props.swiper.duration
  69. },
  70. // 播放到末尾后是否重新回到开头
  71. circular: {
  72. type: Boolean,
  73. default: uni.$u.props.swiper.circular
  74. },
  75. // 前边距,可用于露出前一项的一小部分,nvue和支付宝不支持
  76. previousMargin: {
  77. type: [String, Number],
  78. default: uni.$u.props.swiper.previousMargin
  79. },
  80. // 后边距,可用于露出后一项的一小部分,nvue和支付宝不支持
  81. nextMargin: {
  82. type: [String, Number],
  83. default: uni.$u.props.swiper.nextMargin
  84. },
  85. // 当开启时,会根据滑动速度,连续滑动多屏,支付宝不支持
  86. acceleration: {
  87. type: Boolean,
  88. default: uni.$u.props.swiper.acceleration
  89. },
  90. // 同时显示的滑块数量,nvue、支付宝小程序不支持
  91. displayMultipleItems: {
  92. type: Number,
  93. default: uni.$u.props.swiper.displayMultipleItems
  94. },
  95. // 指定swiper切换缓动动画类型,有效值:default、linear、easeInCubic、easeOutCubic、easeInOutCubic
  96. // 只对微信小程序有效
  97. easingFunction: {
  98. type: String,
  99. default: uni.$u.props.swiper.easingFunction
  100. },
  101. // list数组中指定对象的目标属性名
  102. keyName: {
  103. type: String,
  104. default: uni.$u.props.swiper.keyName
  105. },
  106. // 图片的裁剪模式
  107. imgMode: {
  108. type: String,
  109. default: uni.$u.props.swiper.imgMode
  110. },
  111. // 组件高度
  112. height: {
  113. type: [String, Number],
  114. default: uni.$u.props.swiper.height
  115. },
  116. // 背景颜色
  117. bgColor: {
  118. type: String,
  119. default: uni.$u.props.swiper.bgColor
  120. },
  121. // 组件圆角,数值或带单位的字符串
  122. radius: {
  123. type: [String, Number],
  124. default: uni.$u.props.swiper.radius
  125. },
  126. // 是否加载中
  127. loading: {
  128. type: Boolean,
  129. default: uni.$u.props.swiper.loading
  130. },
  131. // 是否显示标题,要求数组对象中有title属性
  132. showTitle: {
  133. type: Boolean,
  134. default: uni.$u.props.swiper.showTitle
  135. }
  136. }
  137. }