Skip to main content
Version: 3.7

Frontend 前端

前端节点,包含前端的基本信息。

1. 结构声明

class Frontend extends BaseNode {
name: string = '';
title: string;
type: 'pc' | 'h5';
path: string;
documentTitle: string;
documentIcon: string;
bindEvents: Array<BindEvent>;
views: Array<View>;
variables: Array<FrontendVariable>;
theme: Theme = new Theme();
globalScaleEnabled: boolean = false;
canvasWidth: double = 0;
i18nInfo?: I18nInfo;
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "Frontend",
"name": "pc",
"title": "PC端",
"type": "pc",
"path": "/",
"documentTitle": "选课系统PC端",
"documentIcon": "icon.png",
"bindEvents": [],
"views": [],
"variables": [],
"globalScaleEnabled": false,
"canvasWidth": 0,
"theme": {
"concept": "Theme",
"title": "默认主题",
"variableMap": {}
}
}

对应的代码如下:

@(
title = "PC端",
path = "/",
documentTitle = "选课系统PC端",
documentIcon = "icon.png",
globalScaleEnabled = false,
canvasWidth = 0,
)
frontend pc pc {
}

(2) 示例

AST 如下:

{
"concept": "Frontend",
"name": "h5",
"title": "H5端",
"type": "h5",
"path": "/",
"documentTitle": "选课系统H5端",
"documentIcon": "icon.png",
"bindEvents": [],
"views": [],
"variables": [],
"globalScaleEnabled": false,
"canvasWidth": 0,
"theme": {
"concept": "Theme",
"title": "默认主题",
"variableMap": {}
}
}

对应的代码如下:

@(
title = "H5端",
path = "/",
documentTitle = "选课系统H5端",
documentIcon = "icon.png",
globalScaleEnabled = false,
canvasWidth = 0,
)
frontend h5 h5 {
}