feat(schema): 扩展 CSSProperties 类型并完善组件接口注释
- 将 CSSProperties 的值类型从 string 扩展为 string | number | undefined,以支持更灵活的样式定义 - 为 Component 接口的 style 和 props 字段添加详细注释,明确其设计意图和使用规范 - 移除已完成的 TODO 注释
This commit is contained in:
@@ -28,7 +28,25 @@ export interface Component extends Entity {
|
|||||||
*/
|
*/
|
||||||
condition?: Condition;
|
condition?: Condition;
|
||||||
layout: ComponentLayout;
|
layout: ComponentLayout;
|
||||||
|
/**
|
||||||
|
* 组件通用样式
|
||||||
|
*
|
||||||
|
* 承载跨组件通用的、标准的 CSS 视觉属性,仅作用于组件的最外层 DOM 容器。
|
||||||
|
* 必须为静态键值对,不支持动态表达式(DynamicExpression),以保证渲染性能并斩断“无意义的 React 渲染瀑布”。
|
||||||
|
* 任何基于数据流或业务状态的动态视觉变化,应通过 props 或事件触发的 Action 来实现。
|
||||||
|
*
|
||||||
|
* @example { backgroundColor: '#fff', borderRadius: 4, boxShadow: '0 2px 4px rgba(0,0,0,0.1)' }
|
||||||
|
*/
|
||||||
style: CSSProperties;
|
style: CSSProperties;
|
||||||
|
/**
|
||||||
|
* 组件私有属性
|
||||||
|
*
|
||||||
|
* 承载与具体组件类型(type)强绑定的业务语义、内部结构和私有状态。
|
||||||
|
* 支持动态表达式(DynamicExpression),允许属性值随数据流或环境变量动态变化。
|
||||||
|
* 如果组件没有任何自定义属性,该值必须为空对象 `{}`,以消除空值检查成本。
|
||||||
|
*
|
||||||
|
* @example { text: '提交', disabled: false, size: 'large', type: 'primary' }
|
||||||
|
*/
|
||||||
props: Record<string, ComponentPropValue>;
|
props: Record<string, ComponentPropValue>;
|
||||||
/**
|
/**
|
||||||
* 图层管理属性
|
* 图层管理属性
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// TODO: 完善 CSSProperties 接口
|
|
||||||
export interface CSSProperties {
|
export interface CSSProperties {
|
||||||
[key: string]: string;
|
[key: string]: string | number | undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user