有没有可以在表中显示json schema的npm包?

问题描述 投票:0回答:1

我发现了很多npm包,例如x-render,react-jsonschema-form,可以帮助制作表单,但我想编辑表ui中的数据。示例如下:

  {
    $schema: 'http://json-schema.org/draft-04/schema#',
    title: 'json schema',
    type: 'object',
    properties: {
      taskId: {
        type: 'string',
        title: 'taskId',
      },
      description: {
        type: 'string',
        title: 'description',
      }
    },
    required: ['taskId'],
  }

用户界面是 enter image description here

如果图像损坏,就像这样:

title       |  type  | description  |  required
taskId      | string | xxxxxxxxxxx  |   true
description | string | xxxxxxxxxxx  |   false
javascript json npm html-table jsonschema
1个回答
0
投票

如果我正确理解您的要求,您需要一个 npm 包,它可以将 json 呈现到表中,并允许您通过 UI 对其进行编辑。这是正确的吗?

如果是这样,请检查 SlateJs,更具体地说是这个示例 https://www.slatejs.org/examples/tables

正如其中所述,您可以根据需要添加复杂的功能

© www.soinside.com 2019 - 2024. All rights reserved.