FrontendType 端类型
1. 结构声明
- TS Declaration
- JSON Schema
class FrontendType extends BaseNode {
name: 'pc' | 'h5';
kind: 'pc' | 'h5';
frontends: Array<Frontend>;
businessComponents: Array<BusinessComponent>;
componentDependencies: Array<Module>;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string",
"enum": [
"pc",
"h5"
]
},
"kind": {
"type": "string",
"enum": [
"pc",
"h5"
]
},
"frontends": {
"type": "array",
"items": {
"$ref": "#/definitions/Frontend"
}
},
"businessComponents": {
"type": "array",
"items": {
"$ref": "#/definitions/BusinessComponent"
}
},
"componentDependencies": {
"type": "array",
"items": {
"$ref": "#/definitions/Module"
}
}
},
"required": [
"name",
"kind",
"frontends",
"businessComponents",
"componentDependencies"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "FrontendType",
"name": "pc",
"kind": "pc",
"frontends": [
{
"concept": "Frontend",
"name": "h51",
"title": "H5端1",
"type": "h5",
"path": "/",
"documentTitle": "选课系统H5教师端",
"documentIcon": "icon.png",
"bindEvents": [],
"views": [],
"variables": [],
"globalScaleEnabled": false,
"canvasWidth": 0,
"theme": {
"concept": "Theme",
"title": "默认主题",
"variableMap": {}
}
},
{
"concept": "Frontend",
"name": "h52",
"title": "H5端2",
"type": "h5",
"path": "/",
"documentTitle": "选课系统H5学生端",
"documentIcon": "icon.png",
"bindEvents": [],
"views": [],
"variables": [],
"globalScaleEnabled": false,
"canvasWidth": 0,
"theme": {
"concept": "Theme",
"title": "默认主题",
"variableMap": {}
}
}
],
"businessComponents": [],
"componentDependencies": []
}
concept: FrontendType
name: pc
kind: pc
frontends:
- concept: Frontend
name: h51
title: H5端1
type: h5
path: /
documentTitle: 选课系统H5教师端
documentIcon: icon.png
bindEvents: []
views: []
variables: []
globalScaleEnabled: false
canvasWidth: 0
theme:
concept: Theme
title: 默认主题
variableMap: {}
- concept: Frontend
name: h52
title: H5端2
type: h5
path: /
documentTitle: 选课系统H5学生端
documentIcon: icon.png
bindEvents: []
views: []
variables: []
globalScaleEnabled: false
canvasWidth: 0
theme:
concept: Theme
title: 默认主题
variableMap: {}
businessComponents: []
componentDependencies: []
对应的代码如下:
- 文本化 NASL
frontend pc {
}
//
@(
title = "H5端1",
path = "/",
documentTitle = "选课系统H5教师端",
documentIcon = "icon.png",
globalScaleEnabled = false,
canvasWidth = 0,
)
frontend h5 h51 {
}
//
@(
title = "H5端2",
path = "/",
documentTitle = "选课系统H5学生端",
documentIcon = "icon.png",
globalScaleEnabled = false,
canvasWidth = 0,
)
frontend h5 h52 {
}