props.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { defineProps } from '../../libs/util/props';
  2. export default defineProps('barcode', {
  3. // 条形码内容
  4. value: {
  5. type: String,
  6. default: ''
  7. },
  8. // 条形码类型
  9. format: {
  10. type: String,
  11. default: 'CODE128'
  12. },
  13. // 条形码宽度
  14. width: {
  15. type: [String, Number],
  16. default: 2
  17. },
  18. // 条形码高度
  19. height: {
  20. type: [String, Number],
  21. default: 80
  22. },
  23. // 条形码颜色
  24. color: {
  25. type: String,
  26. default: '#000000'
  27. },
  28. // 背景颜色
  29. backgroundColor: {
  30. type: String,
  31. default: 'transparent'
  32. },
  33. // 是否显示文本
  34. displayValue: {
  35. type: Boolean,
  36. default: true
  37. },
  38. // 文本位置
  39. textPosition: {
  40. type: String,
  41. default: 'bottom'
  42. },
  43. // 画布类型
  44. canvasType: {
  45. type: String,
  46. default: '2d'
  47. },
  48. // 字体选项
  49. fontOptions: {
  50. type: String,
  51. default: ''
  52. },
  53. // 字体
  54. font: {
  55. type: String,
  56. default: 'monospace'
  57. },
  58. // 文本对齐方式
  59. textAlign: {
  60. type: String,
  61. default: 'center'
  62. },
  63. // 文本边距
  64. textMargin: {
  65. type: Number,
  66. default: 2
  67. },
  68. // 字体大小
  69. fontSize: {
  70. type: Number,
  71. default: 20
  72. },
  73. // 显示模式 (image/canvas)
  74. mode: {
  75. type: String,
  76. default: 'image'
  77. }
  78. })