【发布时间】:2021-12-23 13:42:46
【问题描述】:
我得到一个具有这种结构的 .json 文件。 我的问题是,我怎样才能有效地读出所有属性并在必要时更改它们?我已经尝试过使用对象,但由于嵌套很多,我不知道如何实现它。
{
"background": {
"active": true,
"layer": {
"img1": {
"color": "green",
"active": true
},
"img2": {
"color": "blue",
"active": true
}
}
},
"front": {
"active": true,
"layer": {
"img1": {
"color": "green",
"active": true
},
"img2": {
"color": "blue",
"active": true
},
"imgX": {
"color": "blue",
"active": true
}
}
}
}
【问题讨论】:
-
能否将我的答案标记为答案,谢谢
-
这不是免费的编码资源,谁来猜你真正需要什么。您必须向我们展示您到目前为止所做的事情以及问题所在。