props.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * @Author : jry
  3. * @Description :
  4. * @version : 3.0
  5. * @LastAuthor : jry
  6. * @lastTime : 2025-08-16 16:35:24
  7. * @FilePath : /uview-plus/components/u-album/props.js
  8. */
  9. import { defineMixin } from '../../libs/vue'
  10. import defProps from '../../libs/config/props.js'
  11. export const props = defineMixin({
  12. props: {
  13. // 图片地址,Array<String>|Array<Object>形式
  14. urls: {
  15. type: Array,
  16. default: () => defProps.album.urls
  17. },
  18. // 指定从数组的对象元素中读取哪个属性作为图片地址
  19. keyName: {
  20. type: String,
  21. default: () => defProps.album.keyName
  22. },
  23. // 单图时,图片长边的长度
  24. singleSize: {
  25. type: [String, Number],
  26. default: () => defProps.album.singleSize
  27. },
  28. // 多图时,图片边长
  29. multipleSize: {
  30. type: [String, Number],
  31. default: () => defProps.album.multipleSize
  32. },
  33. // 多图时,图片水平和垂直之间的间隔
  34. space: {
  35. type: [String, Number],
  36. default: () => defProps.album.space
  37. },
  38. // 单图时,图片缩放裁剪的模式
  39. singleMode: {
  40. type: String,
  41. default: () => defProps.album.singleMode
  42. },
  43. // 多图时,图片缩放裁剪的模式
  44. multipleMode: {
  45. type: String,
  46. default: () => defProps.album.multipleMode
  47. },
  48. // 最多展示的图片数量,超出时最后一个位置将会显示剩余图片数量
  49. maxCount: {
  50. type: [String, Number],
  51. default: () => defProps.album.maxCount
  52. },
  53. // 是否可以预览图片
  54. previewFullImage: {
  55. type: Boolean,
  56. default: () => defProps.album.previewFullImage
  57. },
  58. // 每行展示图片数量,如设置,singleSize和multipleSize将会无效
  59. rowCount: {
  60. type: [String, Number],
  61. default: () => defProps.album.rowCount
  62. },
  63. // 超出maxCount时是否显示查看更多的提示
  64. showMore: {
  65. type: Boolean,
  66. default: () => defProps.album.showMore
  67. },
  68. // 图片形状,circle-圆形,square-方形
  69. shape: {
  70. type: String,
  71. default: () => defProps.image.shape
  72. },
  73. // 圆角,单位任意
  74. radius: {
  75. type: [String, Number],
  76. default: () => defProps.image.radius
  77. },
  78. // 自适应换行
  79. autoWrap: {
  80. type: Boolean,
  81. default: () => defProps.album.autoWrap
  82. },
  83. // 单位
  84. unit: {
  85. type: [String],
  86. default: () => defProps.album.unit
  87. },
  88. // 阻止点击冒泡
  89. stop: {
  90. type: Boolean,
  91. default: () => defProps.album.stop
  92. }
  93. }
  94. })