jd-opensource / drip-form

基于React和JSONSchema的动态表单解决方案
https://jd-opensource.github.io/drip-form/
MIT License
613 stars 73 forks source link

[Bug] 修改组件报错 #104

Closed zty112233 closed 2 years ago

zty112233 commented 2 years ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

当fieldKey为'ui:description.type'这种情况,修改组件会报错:Cannot set properties of undefined (setting 'type')

lowcode

Steps to reproduce

当fieldKey为'ui:description.type'这种情况,修改组件会报错:Cannot set properties of undefined (setting 'type')

Current behavior

当fieldKey为'ui:description.type'这种情况,修改组件会报错:Cannot set properties of undefined (setting 'type')

Expected behavior

当fieldKey为'ui:description.type'这种情况,修改组件会报错:Cannot set properties of undefined (setting 'type')

Your environment

Reproducible demo

No response

Self-service

mengshang918 commented 2 years ago

麻烦提供可以复现的最小schema和使用的主题

zty112233 commented 2 years ago

麻烦提供可以复现的最小schema和使用的主题

最小schema: { "fieldKey": "ui:description.type", "title": "是否展示提示", "ui:type": "radio", "type": "string", "ui:options": [ { "label": "图标", "value": "icon" }, { "label": "文本", "value": "text" }, { "label": "隐藏", "value": "" } ], "default": "icon", "ui:style": { "width": "100%" } }

主题用的是antd

mengshang918 commented 2 years ago

fieldKey暂时不支持. ,原因如下:

  1. drip-form内部嵌套错误信息erros展现形式如下:
    {
    "a.b":"错误信息"
    }
  2. 部分代码根据.分割获取当前fieldKey

在后续完善测试覆盖率场景后,可以支持fieldKey携带.。可以关注后续版本