vue-directory-tree icon indicating copy to clipboard operation
vue-directory-tree copied to clipboard

Fixes #7 use path instead name to identify items

Open soulchainer opened this issue 6 years ago • 1 comments

You can check with the compiler folder (in the initial state there are two already opened).

The problem was that you were using the name as an unique id, and also for saving which items were open, but the name of the folders/files aren't unique, so it drove to this issue. Practical way to solve this (what I did) is to use the file path as identifier, instead of the name. File path is unique :). Con: obviously, it's longer. Another solution would be to give each item a unique identifier, but for that you would need to throw in another dependence, for generating random unique ids. So I guess this approach is a slighly better choice.

soulchainer avatar Oct 12 '18 18:10 soulchainer

Ups. I let my code formatter (prettier plugin) to kick in and did several changes that probably you don't want. I will undo these styling changes and update my PR in no time :). Will update this comment when done.

Edit: solved.

soulchainer avatar Oct 12 '18 18:10 soulchainer