Skip to content

Commit

Permalink
fix: 修改组件初始默认值设置
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry129999 authored and mengshang918 committed Dec 24, 2021
1 parent f4693e8 commit 6ba869f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/drip-form/src/render/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,9 @@ const Render = ({
| any = onValidate?.[item] || null
// 当前Field的错误信息
const error = errors[currentFieldKey] || ''
/*TODO fieldData兜底逻辑
* 现在默认数据均为空字符,后续需优化。否则会触发表单的PropTypes校验
*/
// 当前Field的数据
const cKey = isArrayItem ? (currentArrayKey as number) : item
const fieldData =
currentFormData[cKey] === 0
? currentFormData[cKey]
: currentFormData[cKey] ?? ''
const fieldData = currentFormData[cKey]
// 当前Field是否展示标题
const showTitle = Object.prototype.hasOwnProperty.call(
properties[item],
Expand Down

0 comments on commit 6ba869f

Please sign in to comment.