Skip to main content
Version: 3.7

FrontendType 端类型

1. 结构声明

class FrontendType extends BaseNode {
name: 'pc' | 'h5';
kind: 'pc' | 'h5';
frontends: Array<Frontend>;
businessComponents: Array<BusinessComponent>;
componentDependencies: Array<Module>;
}

2. 节点示例

(1) 示例

AST 如下:

{
"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": []
}

对应的代码如下:

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 {
}