【发布时间】:2019-06-15 02:46:06
【问题描述】:
我有以下分层 JSON 数据。我想将它显示在可折叠和分层的表格中。哪个 React UI 框架/插件支持使用 slide bar for the "volume" 字段显示分层数据?如何实现?
[
{
"id": 1,
"name": "a",
"another": [
{
"anotherId": 2,
"anotherName": "Content1",
"format": [
{
"format": "format1",
"isEnabled": true,
"volume": 8
},
{
"format": "format2",
"isEnabled": true,
"volume": 6
}
]
},
{
"anotherId": 3,
"anotherName": "Content2",
"format": [
{
"format": "format4",
"isEnabled": true,
"volume": 13
},
{
"format": "format5",
"isEnabled": true,
"volume": 20
}
]
}
]
},
{
"id": 2,
"name": "b",
"another": [
{
"anotherId": 6,
"anotherName": "Content6",
"format": [
{
"format": "format6",
"isEnabled": true,
"volume": 7
},
{
"format": "format6",
"isEnabled": false,
"volume": 0
}
]
}
]
}
]
这就是我希望数据显示的方式。
1 a
2 Content1
format1 true -------8-------------
format2 true -----6---------------
3 Content2
format4 true ------------13-------
format5 true --------------------20
2 b
6 Content6
format6 true ------7--------------
format7 false 0--------------------
【问题讨论】:
-
你想要显示数据的方式看起来很乱:) 我推荐github.com/mac-s-g/react-json-view#implementation-example
-
我想要一个 UI 框架。我想要显示数据的方式是使用当您单击父行时可折叠和可扩展的表格或 div。我尝试使用来自
reactstrap的崩溃,但使用更深层次的层次结构具有挑战性
标签: reactjs bootstrap-4 material-ui react-bootstrap