props.js 2.6 KB

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