可用于查看、编辑、格式化与校验 JSON 的编辑器,基于 codemirror
https://github.com/josdejong/jsoneditor
npm install jsoneditor
各框架会有人封装一些包装器,如:
https://github.com/vankop/jsoneditor-react
npm install --save jsoneditor jsoneditor-react --legacy-peer-deps
支持 ts 设置: https://github.com/vankop/jsoneditor-react/issues/65
<ProForm.Item name="config" label="参数内容">
<JsonEditor mode={isView ? 'view' : 'text'} />
</ProForm.Item>