Skip to content

Commit

Permalink
fix(lib): 优化默认formData 计算逻辑,覆盖无效数据
Browse files Browse the repository at this point in the history
fix #299
  • Loading branch information
Jino Liu committed May 14, 2023
1 parent c653452 commit f650884
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/lib/utils/schema/getDefaultFormState.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import retrieveSchema, { /* resolveDependencies, */ resolveAllOf } from './retri
function mergeDefaultsWithFormData(defaults, formData) {
if (Array.isArray(formData)) {
if (!Array.isArray(defaults)) {
defaults = [];
console.warn('无效的formData,已覆盖数据', formData);
return defaults;
}
return formData.map((value, idx) => {
if (defaults[idx]) {
Expand Down

0 comments on commit f650884

Please sign in to comment.