let val = JSON.stringify(res.data);
// \是转义用的 把,"children":[]全部删掉
let result = val.replace(/,"children":\[]/g, '');
tree.value = JSON.parse(result);
02-17
1142
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountBlack.png)
let val = JSON.stringify(res.data);
// \是转义用的 把,"children":[]全部删掉
let result = val.replace(/,"children":\[]/g, '');
tree.value = JSON.parse(result);