Frontend 端
页面的端节点,包含端的基本信息。
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface Frontend {
"concept": "Frontend", // 产品概念
"name": string, // 端标识
"title": string, // pc端
"type": "pc" | "h5", // PC/H5 端
"path": string, // 基础路径
"documentTitle": string, // 制品应用标题
"documentIcon": string, // 制品应用图标
"bindEvents": Array<BindEvent>, // 元素绑定事件列表
"views": Array<View>, // 页面列表
"variables": Array<FrontendVariable>, // 前端全局变量列表
"theme": Theme, // 主题配置
"componentDependencies": Array<Module>, // 扩展组件列表(兼容老版)
"globalScaleEnabled": boolean, // 全局缩放开关
"canvasWidth": number, // 画布宽度
}
class FrontendTreeNode {
ConceptEnum concept; // 产品概念
String name; // 端标识
String title; // pc端
TypeEnum type; // PC/H5 端
String path; // 基础路径
String documentTitle; // 制品应用标题
String documentIcon; // 制品应用图标
List<BindEventTreeNode> bindEvents; // 元素绑定事件列表
List<ViewTreeNode> views; // 页面列表
List<FrontendVariableTreeNode> variables; // 前端全局变量列表
ThemeTreeNode theme; // 主题配置
List<ModuleTreeNode> componentDependencies; // 扩展组件列表(兼容老版)
boolean globalScaleEnabled; // 全局缩放开关
int canvasWidth; // 画布宽度
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/Frontend",
"definitions": {
"Frontend": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "Frontend"
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"pc",
"h5"
]
},
"path": {
"type": "string"
},
"documentTitle": {
"type": "string"
},
"documentIcon": {
"type": "string"
},
"bindEvents": {
"type": "array",
"items": {
"$ref": "#/definitions/BindEvent"
}
},
"views": {
"type": "array",
"items": {
"$ref": "#/definitions/View"
}
},
"variables": {
"type": "array",
"items": {
"$ref": "#/definitions/FrontendVariable"
}
},
"theme": {
"$ref": "#/definitions/Theme"
},
"componentDependencies": {
"type": "array",
"items": {
"$ref": "#/definitions/Module"
}
},
"globalScaleEnabled": {
"type": "boolean"
},
"canvasWidth": {
"type": "number"
}
},
"required": [
"concept",
"name",
"title",
"type",
"path",
"documentTitle",
"documentIcon",
"bindEvents",
"views",
"variables",
"theme",
"componentDependencies",
"globalScaleEnabled",
"canvasWidth"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "Frontend",
"name": "pcFrontend",
"title": "pc端",
"type": "h5",
"path": "m1",
"documentTitle": "",
"documentIcon": "",
"bindEvents": [],
"views": [],
"variables": [],
"componentDependencies": [],
"globalScaleEnabled": false,
"canvasWidth": 0
}
concept: Frontend
name: pcFrontend
title: pc端
type: h5
path: m1
documentTitle: ""
documentIcon: ""
bindEvents: []
views: []
variables: []
componentDependencies: []
globalScaleEnabled: false
canvasWidth: 0