【发布时间】:2019-09-17 19:20:38
【问题描述】:
有json数据如下。
{
"id": 0,
"isLeaf": false,
"name": "root",
"children": [
{
"id": 3,
"isLeaf": false,
"name": "Node 2",
"pid": 0,
"disabled": true
},
{
"id": "new5",
"isLeaf": false,
"name": "new node",
"pid": 0,
"children": [
{
"id": "new7",
"isLeaf": true,
"name": "new leaf",
"pid": "new5"
},
{
"id": "new8",
"isLeaf": true,
"name": "new leaf",
"pid": "new5"
}
]
},
{
"id": "new6",
"isLeaf": false,
"name": "new node",
"pid": 0
}
]
}
我想通过从数据库中获取价格来制作相同的 json 数据。 如果选择值如下:
id isLeaf name pid disabled
new5 false Node2 0 null
new7 true new leaf new5 null
new8 true new leaf new5 null
我怎样才能把它从 json 中提取出来? 我怎样才能让它看起来像上面的json? 请帮帮我。
$.ajax({
```
??????????
```
});
【问题讨论】:
标签: mysql json ajax django vue.js