for example, when I enter the page, I get first-level categories, such as data
.data : [
{
id: "2",
parentId: 1,
name : ""
},
{
id: "2",
parentId: 1,
name : "2"
}
]
then query the API to the backend based on this id, such as the query to id=2, and then get the subordinate
.[
{
id: "5",
parentId: 2,
name : ""
},
{
id: "6",
parentId: 2,
name : "2"
}
]
how to implement, how to insert the query into the parent class as his children