選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

90 行
2.8 KiB

  1. import { defineMixin } from '../../libs/vue'
  2. import ImageDefaultProps from './image'
  3. import { registerComponentProps } from '../../libs/config/props.js'
  4. const defProps = registerComponentProps(ImageDefaultProps)
  5. export const props = defineMixin({
  6. props: {
  7. // 图片地址
  8. src: {
  9. type: String,
  10. default: () => defProps.image.src
  11. },
  12. // 裁剪模式
  13. mode: {
  14. type: String,
  15. default: () => defProps.image.mode
  16. },
  17. // 宽度,单位任意
  18. width: {
  19. type: [String, Number],
  20. default: () => defProps.image.width
  21. },
  22. // 高度,单位任意
  23. height: {
  24. type: [String, Number],
  25. default: () => defProps.image.height
  26. },
  27. // 图片形状,circle-圆形,square-方形
  28. shape: {
  29. type: String,
  30. default: () => defProps.image.shape
  31. },
  32. // 圆角,单位任意
  33. radius: {
  34. type: [String, Number],
  35. default: () => defProps.image.radius
  36. },
  37. // 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序
  38. lazyLoad: {
  39. type: Boolean,
  40. default: () => defProps.image.lazyLoad
  41. },
  42. // 开启长按图片显示识别微信小程序码菜单
  43. showMenuByLongpress: {
  44. type: Boolean,
  45. default: () => defProps.image.showMenuByLongpress
  46. },
  47. // 加载中的图标,或者小图片
  48. loadingIcon: {
  49. type: String,
  50. default: () => defProps.image.loadingIcon
  51. },
  52. // 加载失败的图标,或者小图片
  53. errorIcon: {
  54. type: String,
  55. default: () => defProps.image.errorIcon
  56. },
  57. // 是否显示加载中的图标或者自定义的slot
  58. showLoading: {
  59. type: Boolean,
  60. default: () => defProps.image.showLoading
  61. },
  62. // 是否显示加载错误的图标或者自定义的slot
  63. showError: {
  64. type: Boolean,
  65. default: () => defProps.image.showError
  66. },
  67. // 是否需要淡入效果
  68. fade: {
  69. type: Boolean,
  70. default: () => defProps.image.fade
  71. },
  72. // 只支持网络资源,只对微信小程序有效
  73. webp: {
  74. type: Boolean,
  75. default: () => defProps.image.webp
  76. },
  77. // 过渡时间,单位ms
  78. duration: {
  79. type: [String, Number],
  80. default: () => defProps.image.duration
  81. },
  82. // 背景颜色,用于深色页面加载图片时,为了和背景色融合
  83. bgColor: {
  84. type: String,
  85. default: () => defProps.image.bgColor
  86. }
  87. }
  88. })