File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
packages/lib/src/JsonSchemaForm
fields/combiningSchemas/SelectLinkageField Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,8 @@ export function validateFormDataAndTransformMsg({
164164
165165 // 校验required信息 isEmpty 校验
166166 // 如果数组类型针对配置了 format 的特殊处理
167- const isEmpty = formData === undefined || ( schema . type === 'array' && Array . isArray ( formData ) && formData . length === 0 ) ;
167+ const emptyArray = ( schema . type === 'array' && Array . isArray ( formData ) && formData . length === 0 ) ;
168+ const isEmpty = formData === undefined || emptyArray ;
168169
169170 if ( required ) {
170171 if ( isEmpty ) {
@@ -189,7 +190,7 @@ export function validateFormDataAndTransformMsg({
189190 }
190191 return [ requireErrObj ] ;
191192 }
192- } else if ( isEmpty ) {
193+ } else if ( isEmpty && ! emptyArray ) {
193194 // 非required 为空 校验通过
194195 return [ ] ;
195196 }
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ export default {
144144 // 设置新值
145145 if ( isObject ( newOptionData ) ) {
146146 Object . entries ( newOptionData ) . forEach ( ( [ key , value ] ) => {
147- if ( value !== undefined && curFormData [ key ] === undefined ) {
147+ if ( value !== undefined ) {
148148 setPathVal ( curFormData , key , value ) ;
149149 }
150150 } ) ;
Original file line number Diff line number Diff line change 11<template >
2- <el-checkbox-group v-model =" checkList" >
2+ <el-checkbox-group v-model =" checkList" v-bind = " $attrs " >
33 <el-checkbox v-for =" (item, index) in enumOptions" :key =" index" :label =" item.value" >{{ item.label }}</el-checkbox >
44 </el-checkbox-group >
55</template >
You can’t perform that action at this time.
0 commit comments