FrontendLibrary 端包
扩展模块的端
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface FrontendLibrary {
"concept": "FrontendLibrary", // 产品概念
"name": "pc" | "h5", // 名称与type保持一致
"type": "pc" | "h5", // PC/H5 端
"logics": Array<Logic>, // 逻辑列表
"viewComponents": Array<ViewComponent>, // 平台类型列表
}
class FrontendLibraryTreeNode {
ConceptEnum concept; // 产品概念
NameEnum name; // 名称与type保持一致
TypeEnum type; // PC/H5 端
List<LogicTreeNode> logics; // 逻辑列表
List<ViewComponentTreeNode> viewComponents; // 平台类型列表
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/FrontendLibrary",
"definitions": {
"FrontendLibrary": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "FrontendLibrary"
},
"name": {
"type": "string",
"enum": [
"pc",
"h5"
]
},
"type": {
"type": "string",
"enum": [
"pc",
"h5"
]
},
"logics": {
"type": "array",
"items": {
"$ref": "#/definitions/Logic"
}
},
"viewComponents": {
"type": "array",
"items": {
"$ref": "#/definitions/ViewComponent"
}
}
},
"required": [
"concept",
"name",
"type",
"logics",
"viewComponents"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "FrontendLibrary",
"name": "h5",
"type": "h5",
"logics": [],
"viewComponents": []
}
concept: FrontendLibrary
name: h5
type: h5
logics: []
viewComponents: []