diff --git a/src/schema/component/component.ts b/src/schema/component/component.ts index 29f708b..18402ef 100644 --- a/src/schema/component/component.ts +++ b/src/schema/component/component.ts @@ -28,7 +28,25 @@ export interface Component extends Entity { */ condition?: Condition; 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; + /** + * 组件私有属性 + * + * 承载与具体组件类型(type)强绑定的业务语义、内部结构和私有状态。 + * 支持动态表达式(DynamicExpression),允许属性值随数据流或环境变量动态变化。 + * 如果组件没有任何自定义属性,该值必须为空对象 `{}`,以消除空值检查成本。 + * + * @example { text: '提交', disabled: false, size: 'large', type: 'primary' } + */ props: Record; /** * 图层管理属性 diff --git a/src/schema/shared/css-properties.ts b/src/schema/shared/css-properties.ts index 952bc9b..c012eab 100644 --- a/src/schema/shared/css-properties.ts +++ b/src/schema/shared/css-properties.ts @@ -1,4 +1,3 @@ -// TODO: 完善 CSSProperties 接口 export interface CSSProperties { - [key: string]: string; + [key: string]: string | number | undefined; }