Attribute 组件属性
结构声明
- TS Declaration
- Java Class
- JSON Schema
interface Attribute {
"concept": "Attribute", // 产品概念
"name": string, // 组件属性名称
"group": string, // 组件属性分组
"title": string, // 组件属性标题
"description": string, // 组件属性描述
"typeAnnotation": TypeAnnotation, // 类型
"required": boolean, // 是否必填
"defaultValue": string, // 默认值
"sync": boolean, // 是否支持双向绑定
"advanced": boolean, // 是否为高级功能,不在低代码中显示
"options": Array<{ value: string, title: string}>, // options
}
class AttributeTreeNode {
ConceptEnum concept; // 产品概念
String name; // 组件属性名称
String group; // 组件属性分组
String title; // 组件属性标题
String description; // 组件属性描述
TypeAnnotationTreeNode typeAnnotation; // 类型
boolean required; // 是否必填
String defaultValue; // 默认值
boolean sync; // 是否支持双向绑定
boolean advanced; // 是否为高级功能,不在低代码中显示
Object options; // options
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/Attribute",
"definitions": {
"Attribute": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "Attribute"
},
"name": {
"type": "string"
},
"group": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"required": {
"type": "boolean"
},
"defaultValue": {
"type": "string"
},
"sync": {
"type": "boolean"
},
"advanced": {
"type": "boolean"
},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"title": {
"type": "string"
}
},
"required": [
"value",
"title"
],
"additionalProperties": false
}
}
},
"required": [
"concept",
"name",
"group",
"title",
"description",
"typeAnnotation",
"required",
"defaultValue",
"sync",
"advanced",
"options"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"concept": "Attribute",
"name": "data-source",
"group": "数据属性",
"title": "数据源",
"description": "",
"typeAnnotation": null,
"required": true,
"defaultValue": null,
"sync": true,
"advanced": null,
"options": null
}
concept: Attribute
name: data-source
group: 数据属性
title: 数据源
description: ""
typeAnnotation: null
required: true
defaultValue: null
sync: true
advanced: null
options: null