Skip to content

Commit

Permalink
fix(generator): default configuration is not effective
Browse files Browse the repository at this point in the history
  • Loading branch information
mengshang918 committed Mar 19, 2022
1 parent b6371e2 commit 7e97006
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ const PropertyConfig = () => {
data = {}
}
}
if (key === 'ui.default') {
// 针对数组的default情况,变化的是ui.defualt.0,而不是ui.default;同时要避免ui.default_value,所以需要正则匹配
const changeKeyMap = changeKey.split('.')
if (changeKeyMap[0] === 'ui' && changeKeyMap[1] === 'default') {
changeSchema = 'dataSchema'
// 在ajv校验时,如果formData中已经有值,则不再生成新的formData,需要set formData
setFormData = true
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/schemaHandle/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ const parseUnitedSchema = (
requiredMode: unitedSchema?.requiredMode || 'default',
type: unitedSchema.type || 'object',
...(unitedSchema?.title && { title: unitedSchema.title }),
...(unitedSchema?.default && { default: unitedSchema.default }),
...dataSchema,
...firstLevelProps,
} as DataSchema,
Expand Down

0 comments on commit 7e97006

Please sign in to comment.