Skip to main content
Version: 3.5

BindAttribute 元素绑定属性

1. 结构声明

class BindAttribute extends BaseNode {
name: string = '';
type: 'string' | 'static' | 'dynamic';
value?: string;
expression?: LogicItem;
destination?: Destination;
externalDestination?: ExternalDestination;
rules?: Array<ValidationRule>;
assignee?: Assignee;
model?: boolean;
sync?: boolean;
playground: Array<LogicItem>;
i18nKey: uuid;
}

2. 节点示例

(1) 字符串属性

AST 如下:

{
"concept": "BindAttribute",
"name": "color",
"type": "string",
"value": "primary",
"playground": []
}

(2) 非字符串的静态类型属性

AST 如下:

{
"concept": "BindAttribute",
"name": "min",
"type": "static",
"value": "24",
"playground": []
}

(3) 双向绑定属性

AST 如下:

{
"concept": "BindAttribute",
"name": "visible",
"type": "dynamic",
"expression": {
"concept": "Identifier",
"namespace": "",
"name": "modalVisible"
},
"rules": [],
"sync": true,
"playground": []
}