• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "object",
3  "properties": {
4    "name": {
5      "type": "string",
6      "description": "组件名称,如div、list等"
7    },
8    "version": {
9      "type": "array",
10      "description": "该属性的当前的版本",
11      "items": {
12        "type": "object",
13        "properties": {
14          "name": {
15            "type": "string",
16            "description": "版本号例如:V3.0"
17          },
18        "required": ["name"]
19      }
20    },
21    "description": {
22      "type": "array",
23      "items": {
24        "type": "object",
25        "properties": {
26          "name": {
27            "type": "string",
28            "description": "属性的描述文档"
29          }
30        },
31        "required": ["name"]
32      }
33    },
34    "attributes": {
35      "type": "array",
36      "description": "组件的属性信息",
37      "items": {
38        "type": "object",
39        "properties": {
40          "name": {
41            "type": "string",
42            "description": "属性名称"
43          },
44          "required": {
45            "type": "boolean",
46            "description": "表示属性是否为组件的必填属性"
47          },
48          "description": {
49            "type": "array",
50            "items": {
51              "type": "object",
52              "properties": {
53                "name": {
54                  "type": "string",
55                  "description": "属性的描述文档"
56                }
57              },
58              "required": ["name"]
59            }
60          },
61          "type": {
62            "type": "string",
63            "description": "属性的类型"
64          },
65          "options": {
66            "type": "array",
67            "description": "本字段非必填,表示属性值的枚举类型,当属性type为'enum'时才生效",
68            "items": {
69              "type": "object",
70              "properties": {
71                "name": {
72                  "type": "string",
73                  "description": "属性值"
74                }
75              },
76              "required": ["name"]
77            }
78          }
79        },
80        "required": ["name", "required", "description", "type"]
81      }
82    },
83    "events": {
84      "type": "array",
85      "description": "组件支持的事件",
86      "items": {
87        "type": "object",
88        "properties": {
89          "name": {
90            "type": "string",
91            "description": "事件名称"
92          },
93          "description": {
94            "type": "array",
95            "items": {
96              "type": "object",
97              "properties": {
98                "name": {
99                  "type": "string",
100                  "description": "事件的描述文档"
101                }
102              }
103            }
104          }
105        },
106        "required": ["name", "description"]
107      }
108    },
109    "supportedSubComponents": {
110      "type": "boolean",
111      "description": "组件是否支持子组件,参数为false表示不支持子组件,为true表示支持子组件。当参数为true并且supportedSubComponentsRestriction为空时,表示支持所以子组件"
112    },
113    "supportedSubComponentsRestriction": {
114      "type": "array",
115      "description": "组件支持的子组件列表",
116      "items": {
117        "type": "object",
118        "properties": {
119          "name": {
120            "type": "string",
121            "description": "支持的子组件名称"
122          },
123          "level": {
124            "type": "number"
125          }
126        },
127        "required": ["name"]
128      }
129    },
130    "unSupportSubComponentsRestriction": {
131      "type": "array",
132      "description": "组件不支持的子组件列表",
133      "items": {
134        "type": "object",
135        "properties": {
136          "name": {
137            "type": "string",
138            "description": "不支持的子组件名称"
139          },
140          "level": {
141            "type": "number"
142          }
143        },
144        "required": ["name"]
145      }
146    },
147    "parentComponentsRestriction": {
148      "type": "array",
149      "description": "支持的父组件列表,即只支持列表中的组件作为自己的父组件",
150      "items": {
151        "type": "object",
152        "properties": {
153          "name": {
154            "type": "string",
155            "description": "支持的父组件的组件名称"
156          },
157          "level": {
158            "type": "number",
159            "description": "本字段非必填,取值范围大于等于1,只有标签补齐时需要联想出对应子组件时需要填此字段,如果level为n+1时,level为n的组件有且只有一个(n>1)"
160          }
161        },
162        "required": ["name"]
163      }
164    }
165  },
166  "required": [
167    "name",
168    "version",
169    "description",
170    "attributes",
171    "events",
172    "supportedSubComponents",
173    "supportedSubComponentsRestriction",
174    "unSupportSubComponentsRestriction",
175    "parentComponentsRestriction"
176  ]
177}
178