props.js 3.0 KB

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