holiber / sl-vue-tree

Customizable draggable tree component for Vue.js
MIT License
344 stars 79 forks source link

Introducing a new prop to allow multi-selection with metaKey #13

Closed onekiloparsec closed 6 years ago

onekiloparsec commented 6 years ago

Hi,

After playing hours (if not days) with vue ports of Draggable.js and Sortable.js, your project came as a lifebuoy...

However, I needed to be able to select multiple nodes but not with the Control Key (which triggers the opening of a right-click menu, and discard the selection event itself!).

I though a new prop would be useful, so here it is.

Sorry for the multiple commits (my IDE screwed complegtely the existing code style, and while disantengling the diffs, it came as multiple commits).

onekiloparsec commented 6 years ago

One more thing... For Array defaults, one must return factory function. So instead of default: ['ctlrKey', 'metaKey'] for the 'multiselectKey' prop, one must write: default () { return ['ctrlKey', 'metaKey'] }, You want me to create another PR or you can change it directly ?

holiber commented 6 years ago

Yes, you can. Actually, I'm working on v2 of sl-vue-tree now, and for v1 I'm accepting mostly supporting PRs from the community.