File tree Expand file tree Collapse file tree 7 files changed +18
-15
lines changed
demo/src/schema-generator/views/editor/components
lib/src/JsonSchemaForm/fieldComponents Expand file tree Collapse file tree 7 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 169169 }
170170 }
171171
172+ .formItemWrap {
173+ width : 100% ;
174+ box-sizing : border-box ;
175+ font-size : 0 ;
176+ }
177+
172178 /* column 布局 */
173179 .layoutColumn {
174180 .w 100 {
175181 width : 100% !important ;
176182 }
177183 :local {
178184 .formItemWrap {
179- width : 100% ;
180- box-sizing : border-box ;
181- font-size : 0 ;
182185 :global {
183186 .el-form-item {
184187 width: 100% !important ;
Original file line number Diff line number Diff line change 5151 :child-component-list =" editorItem.childList"
5252 :drag-options =" dragOptions"
5353 :form-data =" formData"
54+ :form-props =" formProps"
5455 >
5556 </NestedEditor >
5657 </div >
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ sidebarDepth: 2
1717
1818::: warning
1919在使用通过UI配置的方式时,可能打破 ` JSON Schema ` 规范,所以在使用时需要注意避免和 ` JSON Schema ` 描述的数据结构冲突。
20- > 比如:配置了 ` required ` , 但ui-schema又配置了 ` ui:hidden: false ` ,必须输入又不显示 ....
20+ > 比如:配置了 ` required ` , 但ui-schema又配置了 ` ui:hidden: true ` ,必须输入又不显示 ....
2121
2222如果冲突因为生成的表单中会只校验显示的元素所以不会存在问题,但即使是表单通过了校验,数据结构也已经不在符合了,所以一定要避免....
2323:::
@@ -309,7 +309,7 @@ export default {
309309就目前来看 if else 比较容易解决数据联动的场景,可以根据值来做判断,但依旧不能解决对值支持逻辑判断,比如` 大于 ` 、` 小于 ` ,后续版本会考虑支持该特性。
310310
311311## ui-schema配置表达式
312- 可能打破 ` JSON Schema ` 规范,配置思想来源 [ ali form-render] ( https://github.com/alibaba/form-render ) ,目前只支持对 ui -schema ` ui:hidden ` 配置表达式。
312+ 可能打破 ` JSON Schema ` 规范,配置思想来源 [ ali form-render] ( https://github.com/alibaba/form-render ) ,通过对ui -schema ` ui:hidden ` 配置表达式。
313313
314314** ui: hidden 实际不仅仅只支持表达式,详细的包含如下三种格式:**
315315
Original file line number Diff line number Diff line change @@ -102,6 +102,6 @@ function render(h) {
102102## 设计思想
103103
104104* 设计思想借鉴[ react-jsonschema-form] ( https://github.com/rjsf-team/react-jsonschema-form ) ,
105- 在对schema的解析索引也使用了 ` react-json-schema ` 的源码。
105+ 在对schema的解析索引也使用了 ` react-json-schema ` 的源码,同时也顺便解决了一些原有的小问题 。
106106
107107* 在用户输入的时候可以最小程度的重新渲染,做到在绝大部分的场景都是只需要重新渲染输入内容的 ` Widget ` 组件。
Original file line number Diff line number Diff line change 22
33## 不支持 (持续更新)
44目前对标准JSON Schema不支持的部分包含可能不限于如下:
5- 1 . object additionalProperties 属性只支持配置false
6- 1 . object Dependencies schema依赖不支持
7- 1 . if else 新特性不支持
8- 1 . $ref 不支持跨文件调用
5+ 1 . object additionalProperties 属性只支持配置false(暂不计划)
6+ 1 . object Dependencies schema依赖不支持(暂不计划)
7+ 1 . if else 新特性不支持(暂不计划)
8+ 1 . $ref 不支持跨文件调用(暂不计划)
99
1010## Todo
1111- [x] anyOf 嵌套数组调整顺序的时候数据渲染异常问题修复
2525- [x] 支持属性依赖 [ 属性依赖] ( https://json-schema.org/understanding-json-schema/reference/object.html#property-dependencies )
2626- [x] 支持 ui: hidden 使用 mustache 表达式
2727- [x] 支持 所有ui配置使用 mustache 表达式
28- - [ ] 支持Schema依赖 [ Schema依赖] ( https://json-schema.org/understanding-json-schema/reference/object.html#schema-dependencies )
2928- [ ] 添加代码测试
30- - [ ] 对照react schema from适配更多规则支持
31- - [ ] 解耦elementUi 重新开发form 和formItem组件,通过配置化实现适配elementUi iView 等常用ui组件
29+ - [ ] 支持Vue3
30+ - [ ] 适配elementUi、 iView、Ant vue 等常用ui组件
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const customRule = ({
3939> * ` rootFormData ` :根节点` formData ` 数据,响应式数据,避免直接修改数据
4040> * ` callback ` :` function ` 必须调用 ` callback ` 返回当前的校验结果,不传参数说明校验通过
4141
42- 配置了 ` custom-rule ` 你将会获得最大程度的自定义校验,所有的表单项都会通过改方法处理 。
42+ 配置了 ` custom-rule ` 你将会获得最大程度的自定义校验,所有的表单项都会通过该方法处理 。
4343调用者需要自行匹配 ` field ` 参数来判断是否为你所需要校验的字段。
4444
4545::: tip
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ export default {
155155 // array 渲染为多选框时默认为空数组
156156 if ( this . schema . items ) {
157157 this . value = [ ] ;
158- } else {
158+ } else if ( this . required ) {
159159 this . value = this . uiProps . enumOptions [ 0 ] . value ;
160160 }
161161 }
You can’t perform that action at this time.
0 commit comments