alibaba / x-render

🚴‍♀️ 阿里 - 很易用的中后台「表单 / 表格 / 图表」解决方案
https://xrender.fun
6.91k stars 980 forks source link

Schema 传入JSX会报错 #1484

Closed MoYuM closed 4 months ago

MoYuM commented 4 months ago

1.依赖仓库的版本(Dependencies versions)

2.问题描述(Bug description): 如果schema中传入jsx的话,页面直接报错

3.出现问题的 schema demo(Reproduction schema demo)

const schema = {
        type: 'object',
      properties: {
        type: {
          title: '联系人',
          type: 'string',
          props: {
            options: [
{label: <div>123</div>, key: 1}
]
          },
        },
  }
}

4.最小复现 demo(Reproduction demo)

demo

MoYuM commented 4 months ago

具体报错位置是这里 image

lhbxs commented 4 months ago

schema 不支持这种 JSX 的配置,schema 推荐的是保持 JSON 的方式,这样保证了远程配置的一致性。你这种更倾向自定义一个 widget。