DEV Community

loading...

How to make JSON file to tree structure

almantas88
I'm a multimedia technologies student at Kaunas College. I also work as an IT administrator at a school.
・1 min read

I give front end data from back-end (Node.js and Firebase/firestore)
Data:
image

How does front-end (Vue.js) render this data as a tree, like this:

image

Discussion (3)

Collapse
aiosifelisl1 profile image
Andreas Iosifelis
Collapse
almantas88 profile image
almantas88 Author

does this do the trick with children id references? Because back-end send data as a plain json object, but not a tree.

Collapse
aiosifelisl1 profile image
Andreas Iosifelis

From what I understand this module will display a json object in a UI format. If you want a specific structure, you're going to have to massage your data into that structure first and then feed it into the module.