Skip to content

Commit b7fab31

Browse files
committed
* form-builder: update required field type in BaseSchema and ObjectSchema to support string arrays for enhanced flexibility in schema definitions.
1 parent 9713cf9 commit b7fab31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/form-builder/src/types/json-schema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface BaseSchema<T = unknown> {
6969
/** 传递给组件的额外属性,支持 JavaScript 表达式 */
7070
props?: Record<string, unknown>;
7171
/** 是否为必填字段,支持 JavaScript 表达式 */
72-
required?: boolean;
72+
required?: boolean | string[];
7373
/** 工具提示文本,支持 JavaScript 表达式 */
7474
tooltip?: string;
7575
/** 提示信息文本,支持 JavaScript 表达式 */
@@ -139,6 +139,8 @@ export interface ObjectSchema extends BaseSchema<Record<string, unknown>> {
139139
properties: Record<string, JSONSchema>;
140140
/** 是否默认折叠显示,'disabled' 表示不可折叠 */
141141
collapsed?: boolean | 'disabled';
142+
/** 必填字段 */
143+
required?: string[];
142144
}
143145

144146
/**

0 commit comments

Comments
 (0)