jledentu / vue-finder

📁 A Vue.js component to display hierarchical data (like the MacOS X finder)
https://vue-finder.netlify.app
MIT License
160 stars 16 forks source link

Breadcrumbs #124

Closed chasedeanda closed 4 years ago

chasedeanda commented 4 years ago

It'd be great if there were breadcrumbs included or if there was an event for when an item was clicked on so we can add them ourselves. Is there anyway to get the current active items?

jledentu commented 4 years ago

I prefer to not add too much UI in this library in order to make it lightweight, but you can add it relatively simply by using the expand event:

expand({
  expanded
}) {
  // `expanded` contains the list of IDs of expanded items: parent > child > ... > leaf
}

expanded contains a list of IDs rather than full objects, I guess I could improve that.

chasedeanda commented 4 years ago

Thank you for your response! Yeah this solution worked out well. Returning the full object would be much easier to work with so we don't have to walk the tree to find the correct node just to display its name.