Skip to content

Commit

Permalink
feat(Json): 初始化兼容数据类型优化[editor]
Browse files Browse the repository at this point in the history
  • Loading branch information
duqingyu authored and jianbing.chen committed Dec 18, 2024
1 parent ae822f0 commit 15ad366
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/editor/src/packages/FormItems/Json/Json.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const MJson = ({ id, type, config, onAdd, onEdit, onDelete }: ComponentType<ICon
const name: string = config.props.formItem?.name;
const value = config.props.defaultValue;
// JsonView 只支持对象,所以不是对象格式需要转成对象格式。
const jsonValue = ['string', 'number', 'boolean'].includes(value) ? value : {};
const jsonValue = ['string', 'number', 'boolean'].includes(typeof value) ? { value } : value;
initValues(type, name, jsonValue);
}, [config.props.defaultValue]);

Expand Down

0 comments on commit 15ad366

Please sign in to comment.