config.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. const title = '边框组件'
  2. // 右侧配置项
  3. const setting = [
  4. {
  5. label: '对齐类型',
  6. // 设置组件类型, select / input / colorPicker
  7. type: 'select',
  8. // 字段
  9. field: 'customize_diagonalType',
  10. optionField: 'customize.diagonalType', // 对应options中的字段
  11. // 是否多选
  12. multiple: false,
  13. options: [
  14. {
  15. label: '左上右下',
  16. value: 'leftTopRightBottom'
  17. },
  18. {
  19. label: '右上左下',
  20. value: 'rightTopLeftBottom'
  21. }
  22. ],
  23. // 绑定的值
  24. value: 'leftTopRightBottom',
  25. // tab页。 data: 数据, custom: 自定义
  26. tabName: 'custom'
  27. },
  28. {
  29. label: '背景颜色',
  30. // 设置组件类型, select / input / colorPicker
  31. type: 'colorPicker',
  32. // 字段
  33. field: 'customize_backgroundColor',
  34. optionField: 'customize.backgroundColor', // 对应options中的字段
  35. // 是否多选
  36. multiple: false,
  37. // 绑定的值
  38. value: '#D3D3D32B',
  39. // tab页。 data: 数据, custom: 自定义
  40. tabName: 'custom'
  41. },
  42. {
  43. label: '长度',
  44. // 设置组件类型, select / input / colorPicker
  45. type: 'inputNumber',
  46. // 字段
  47. field: 'customize_borderLength',
  48. optionField: 'customize.borderLength', // 对应options中的字段
  49. // 是否多选
  50. multiple: false,
  51. // 绑定的值
  52. value: '30',
  53. // tab页。 data: 数据, custom: 自定义
  54. tabName: 'custom'
  55. },
  56. {
  57. label: '粗细',
  58. // 设置组件类型, select / input / colorPicker
  59. type: 'inputNumber',
  60. // 字段
  61. field: 'customize_borderWidth',
  62. optionField: 'customize.borderWidth', // 对应options中的字段
  63. // 是否多选
  64. multiple: false,
  65. // 绑定的值
  66. value: '4',
  67. // tab页。 data: 数据, custom: 自定义
  68. tabName: 'custom'
  69. },
  70. {
  71. label: '边框颜色',
  72. // 设置组件类型, select / input / colorPicker
  73. type: 'colorPicker',
  74. // 字段
  75. field: 'customize_borderColor',
  76. optionField: 'customize.borderColor', // 对应options中的字段
  77. // 是否多选
  78. multiple: false,
  79. // 绑定的值
  80. value: '#409EFF',
  81. // tab页。 data: 数据, custom: 自定义
  82. tabName: 'custom'
  83. },
  84. {
  85. label: '边框圆角',
  86. // 设置组件类型, select / input / colorPicker
  87. type: 'inputNumber',
  88. // 范围
  89. min: 0,
  90. max: 100,
  91. // 字段
  92. field: 'customize_borderRadius',
  93. optionField: 'customize.borderRadius', // 对应options中的字段
  94. // 是否多选
  95. multiple: false,
  96. // 绑定的值
  97. value: 4,
  98. // tab页。 data: 数据, custom: 自定义
  99. tabName: 'custom'
  100. }
  101. ]
  102. // 模拟数据
  103. const option = {
  104. // 自定义组件其他属性
  105. customize: {
  106. diagonalType: 'leftTopRightBottom',
  107. borderLength: 30,
  108. borderWidth: 4,
  109. backgroundColor: '#D3D3D32B',
  110. borderRadius: 0,
  111. borderColor: '#409EFF'
  112. }
  113. }
  114. export default {
  115. title,
  116. setting,
  117. option: {
  118. ...option,
  119. displayOption: {
  120. dataAllocation: {
  121. enable: false
  122. }
  123. }
  124. }
  125. }