ViewElement 页面元素
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface ViewElement {
"concept": "ViewElement", // 产品概念
"type": 0, // 类型
"tag": string, // 元素标签
"name": string, // 页面元素名称,对应 Vue 的 ref
"staticClass": string, // 静态 class 名,暂无计划支持动态 class
"staticStyle": string, // 静态 style,暂无计划支持动态 style
"authDescription": string, // 权限资源描述
"slotTarget": string, // 插槽目标
"slotScope": string, // 插槽 scope 表达式
"bindAttrs": Array<BindAttribute>, // 元素绑定属性列表
"bindEvents": Array<BindEvent>, // 元素绑定事件列表
"bindDirectives": Array<BindDirective>, // 元素指令列表
"bindRoles": Array<string>, // 绑定的角色
"bindStyles": Array<BindStyle>, // 元素绑定样式列表
"children": Array<ViewElement>, // 子元素列表
}
class ViewElementTreeNode {
ConceptEnum concept; // 产品概念
TypeEnum type; // 类型
String tag; // 元素标签
String name; // 页面元素名称,对应 Vue 的 ref
String staticClass; // 静态 class 名,暂无计划支持动态 class
String staticStyle; // 静态 style,暂无计划支持动态 style
String authDescription; // 权限资源描述
String slotTarget; // 插槽目标
String slotScope; // 插槽 scope 表达式
List<BindAttributeTreeNode> bindAttrs; // 元素绑定属性列表
List<BindEventTreeNode> bindEvents; // 元素绑定事件列表
List<BindDirectiveTreeNode> bindDirectives; // 元素指令列表
List<String> bindRoles; // 绑定的角色
List<BindStyleTreeNode> bindStyles; // 元素绑定样式列表
List<ViewElementTreeNode> children; // 子元素列表
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/ViewElement",
"definitions": {
"ViewElement": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "ViewElement"
},
"type": {
"type": "number",
"const": 0
},
"tag": {
"type": "string"
},
"name": {
"type": "string"
},
"staticClass": {
"type": "string"
},
"staticStyle": {
"type": "string"
},
"authDescription": {
"type": "string"
},
"slotTarget": {
"type": "string"
},
"slotScope": {
"type": "string"
},
"bindAttrs": {
"type": "array",
"items": {
"$ref": "#/definitions/BindAttribute"
}
},
"bindEvents": {
"type": "array",
"items": {
"$ref": "#/definitions/BindEvent"
}
},
"bindDirectives": {
"type": "array",
"items": {
"$ref": "#/definitions/BindDirective"
}
},
"bindRoles": {
"type": "array",
"items": {
"type": "string"
}
},
"bindStyles": {
"type": "array",
"items": {
"$ref": "#/definitions/BindStyle"
}
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/ViewElement"
}
}
},
"required": [
"concept",
"type",
"tag",
"name",
"staticClass",
"staticStyle",
"authDescription",
"slotTarget",
"slotScope",
"bindAttrs",
"bindEvents",
"bindDirectives",
"bindRoles",
"bindStyles",
"children"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "ViewElement",
"type": 0,
"tag": "u-table-view",
"name": "table1",
"staticClass": "custom-table",
"staticStyle": "position: absolute; display: flex;",
"authDescription": "学生信息资源描述",
"slotTarget": "cell",
"slotScope": "scope",
"bindAttrs": [],
"bindEvents": [],
"bindDirectives": [],
"bindRoles": [],
"bindStyles": [],
"children": []
}
concept: ViewElement
type: 0
tag: u-table-view
name: table1
staticClass: custom-table
staticStyle: "position: absolute; display: flex;"
authDescription: 学生信息资源描述
slotTarget: cell
slotScope: scope
bindAttrs: []
bindEvents: []
bindDirectives: []
bindRoles: []
bindStyles: []
children: []