vue-treeview icon indicating copy to clipboard operation
vue-treeview copied to clipboard

Support click event

Open oeway opened this issue 4 years ago • 4 comments

Hi, thanks for the great work! I would like to use it for showing a file tree but I will need the click event. Do you have plan to support that? It would be even better if you support slot so I can add the click event myself.

oeway avatar Oct 27 '20 20:10 oeway

Hey!

Can you clarify what you want to do with the @click event? Currently the click event is used for navigation purpose.

Implementing slot would take some time since the tree is generated from the data you supply to the plugin.

ll931217 avatar Oct 27 '20 23:10 ll931217

Yes, I would like to display a file tree, when the user click on the file or folder name, a function that fetches more details about the file or folder will be called.

For the slot, I would like to plug-in a template, and depending on the type key or name of the nodes, I will render them differently. For example, it is an image file (ends with extension .jpg, .png etc.), I will show an image icon and call a display image function when double clicked.

oeway avatar Oct 27 '20 23:10 oeway

Currently, you can do something similar to what you want, if you take a look at router, tree, and application. This should be able to display a file (image), with the link from the tree.

ll931217 avatar Oct 27 '20 23:10 ll931217

Currently, you can do something similar to what you want, if you take a look at router, tree, and application. This should be able to display a file (image), with the link from the tree.

I have already checked it before, but the issue is that I cannot implement them as a route, it has to be a straight function call.

oeway avatar Oct 27 '20 23:10 oeway