props.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { defineProps } from '../../libs/util/props';
  2. export default defineProps('cropper', {
  3. // 是否显示
  4. show: {
  5. type: Boolean,
  6. default: false
  7. },
  8. // 裁剪框形状,circle-圆形,square-方形
  9. shape: {
  10. type: String,
  11. default: 'square'
  12. },
  13. // 取消按钮的文字
  14. cancelText: {
  15. type: String,
  16. default: () => uni.$u.$t('uAreaPicker.cancelText')
  17. },
  18. // 确认按钮的文字
  19. confirmText: {
  20. type: String,
  21. default: () => uni.$u.$t('uAreaPicker.confirmText')
  22. },
  23. // 每次显示时是否自动打开选择图片
  24. autoChoose: {
  25. type: Boolean,
  26. default: true
  27. },
  28. // 裁剪框宽度,单位px
  29. rectWidth: {
  30. type: [String, Number],
  31. default: 300
  32. },
  33. // 裁剪框高度,单位px
  34. rectHeight: {
  35. type: [String, Number],
  36. default: 300
  37. },
  38. // 输出图片宽度,单位px
  39. width: {
  40. type: [String, Number],
  41. default: 400
  42. },
  43. // 输出图片高度,单位px
  44. height: {
  45. type: [String, Number],
  46. default: 400
  47. },
  48. // 输出的图片类型,如果发现裁剪的图片很大,可能是因为设置为了"png",改成"jpg"即可
  49. fileType: {
  50. type: String,
  51. default: 'jpg'
  52. },
  53. // 输出图片质量,0-1
  54. quality: {
  55. type: [String, Number],
  56. default: 0.9
  57. },
  58. // 是否显示网格线
  59. showGrid: {
  60. type: Boolean,
  61. default: true
  62. },
  63. // 小程序的打开方式
  64. openType: {
  65. type: String,
  66. default: ''
  67. },
  68. // 水印文字
  69. watermark: {
  70. type: Object,
  71. default: () => ({
  72. text: '',
  73. text: '',
  74. bold: false,
  75. color: 'rgba(0, 0, 0, 0.2)',
  76. fontSize: 16,
  77. fontFamily: 'Arial',
  78. rotate: -30,
  79. spacing: 100,
  80. single: false
  81. })
  82. }
  83. })