props.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // 头像图片组
  6. urls: {
  7. type: Array,
  8. default: () => defProps.avatarGroup.urls
  9. },
  10. // 最多展示的头像数量
  11. maxCount: {
  12. type: [String, Number],
  13. default: () => defProps.avatarGroup.maxCount
  14. },
  15. // 头像形状
  16. shape: {
  17. type: String,
  18. default: () => defProps.avatarGroup.shape
  19. },
  20. // 图片裁剪模式
  21. mode: {
  22. type: String,
  23. default: () => defProps.avatarGroup.mode
  24. },
  25. // 超出maxCount时是否显示查看更多的提示
  26. showMore: {
  27. type: Boolean,
  28. default: () => defProps.avatarGroup.showMore
  29. },
  30. // 头像大小
  31. size: {
  32. type: [String, Number],
  33. default: () => defProps.avatarGroup.size
  34. },
  35. // 指定从数组的对象元素中读取哪个属性作为图片地址
  36. keyName: {
  37. type: String,
  38. default: () => defProps.avatarGroup.keyName
  39. },
  40. // 头像之间的遮挡比例
  41. gap: {
  42. type: [String, Number],
  43. validator(value) {
  44. return value >= 0 && value <= 1
  45. },
  46. default: () => defProps.avatarGroup.gap
  47. },
  48. // 需额外显示的值
  49. extraValue: {
  50. type: [Number, String],
  51. default: () => defProps.avatarGroup.extraValue
  52. }
  53. }
  54. })