menu表示组件的配置项类型为菜单。菜单用来组织配置项的结构。

配置项说明

字段名 含义 类型 是否必选 备注
name 显示名 string
type 类型 string
children 组内元素 object name:菜单名称
mode:菜单类型,”single”:一级菜单,”multiple”:二级菜单

配置示例

menu.png

  1. "menu": {
  2. "type": "menu",
  3. "children": {
  4. "general": {
  5. "name": "通用",
  6. "mode": "single",
  7. "children": {
  8. "initValue": {
  9. "name": "初始化值",
  10. "type": "text",
  11. "default": 1
  12. },
  13. "queueMode": {
  14. "name": "排列方式",
  15. "type": "radio",
  16. "options": [
  17. {
  18. "label": "水平方向",
  19. "value": "hori"
  20. },
  21. {
  22. "label": "垂直方向",
  23. "value": "verti"
  24. }
  25. ],
  26. "default": "hori"
  27. },
  28. "alignment": {
  29. "name": "对齐方式",
  30. "type": "radio",
  31. "options": [
  32. {
  33. "label": "左对齐",
  34. "value": "flex-start"
  35. },
  36. {
  37. "label": "居中对齐",
  38. "value": "center"
  39. },
  40. {
  41. "label": "右对齐",
  42. "value": "flex-end"
  43. }
  44. ],
  45. "default": "center"
  46. }
  47. }
  48. },
  49. "graph": {
  50. "name": "图形",
  51. "mode": "multiple",
  52. "children": {
  53. "x": {
  54. "name": "x轴",
  55. "children": {
  56. "text": {
  57. "type": "text",
  58. "name": "输入框",
  59. "default": "123"
  60. }
  61. }
  62. },
  63. "y": {
  64. "name": "y轴",
  65. "children": {
  66. "number": {
  67. "type": "number",
  68. "name": "位置",
  69. "default": 10
  70. }
  71. }
  72. }
  73. }
  74. }
  75. }
  76. }