PropDeclaration 组件属性
1. 结构声明
- TS Declaration
- JSON Schema
class PropDeclaration extends BaseNode {
name: string = '';
title: string;
group!: '基础信息' | '数据属性' | '主要属性' | '交互属性' | '状态属性' | '样式属性' | '工具属性';
icon?: string;
description?: string;
tsType: TSExpression;
sync!: boolean;
tooltipLink?: string;
docDescription?: string;
bindHide!: boolean;
bindOpen!: boolean;
tabKind!: 'property' | 'style';
setter!: BaseSetter;
layout!: 'block' | 'inline';
defaultValue?: DefaultValue;
tsDesignerValue?: TSExpression<'any'>;
tsIf?: TSExpression<'(target: T) => boolean'>;
tsDisabledIf?: TSExpression<'(target: T) => boolean'>;
tsOnChange?: TSExpression<'Array<{ update: any; if?: (value: T[K]) => boolean } | { clear: Array<string>; if?: (value: T[K]) => boolean }>'>;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string"
},
"title": {
"type": "string"
},
"group": {
"type": "string",
"enum": [
"基础信息",
"数据属性",
"主要属性",
"交互属性",
"状态属性",
"样式属性",
"工具属性"
]
},
"icon": {
"type": "string"
},
"description": {
"type": "string"
},
"tsType": {
"$ref": "#/definitions/TSExpression"
},
"sync": {
"type": "boolean"
},
"tooltipLink": {
"type": "string"
},
"docDescription": {
"type": "string"
},
"bindHide": {
"type": "boolean"
},
"bindOpen": {
"type": "boolean"
},
"tabKind": {
"type": "string",
"enum": [
"property",
"style"
]
},
"setter": {
"$ref": "#/definitions/BaseSetter"
},
"layout": {
"type": "string",
"enum": [
"block",
"inline"
]
},
"defaultValue": {
"$ref": "#/definitions/DefaultValue"
},
"tsDesignerValue": {
"$ref": "#/definitions/TSExpression%3C%22any%22%3E"
},
"tsIf": {
"$ref": "#/definitions/TSExpression%3C%22(target%3A%20T)%20%3D%3E%20boolean%22%3E"
},
"tsDisabledIf": {
"$ref": "#/definitions/TSExpression%3C%22(target%3A%20T)%20%3D%3E%20boolean%22%3E"
},
"tsOnChange": {
"$ref": "#/definitions/TSExpression%3C%22Array%3C%7B%20update%3A%20any%3B%20if%3F%3A%20(value%3A%20T%5BK%5D)%20%3D%3E%20boolean%20%7D%20%7C%20%7B%20clear%3A%20Array%3Cstring%3E%3B%20if%3F%3A%20(value%3A%20T%5BK%5D)%20%3D%3E%20boolean%20%7D%3E%22%3E"
}
},
"required": [
"name",
"title",
"group",
"tsType",
"sync",
"bindHide",
"bindOpen",
"tabKind",
"setter",
"layout"
],
"additionalProperties": false
}