Any examples for working with a pre-existing data structure?
Opened this issue · 0 comments
egeersoz commented
Trying to have sl-vue-tree display an existing nested data structure. Example:
{"Activities": [
{
"Options": {
"User ID": 1000
},
"Name": "Find Projects",
"Activity Type ID": 5
},
{
"Name": "For Each Project",
"Activity Type ID": 6,
"Activities": [
{
"Name": "Find the Project",
"Activity Type ID": 4
},
{
"Name": "Assign Task",
"Activity Type ID": 7
},
]
}
]
}
I managed to have sl-vue-tree display the top nodes using this:
this.activities = this.process.Activities.map(activity => {
return {
title: activity.Name,
'children?': activity.Activities,
'isLeaf?': true,
'isExpanded?': true,
'isSelected?': false,
'isDraggable?': true,
'isSelectable?': true
}
})
})
But the second one, which has children, won't expand and show them.