stephan281094 / vue-drag-select

A Vue component for drag selecting elements. Inspired by react-drag-select.
75 stars 26 forks source link

Make `selectorClass` accept function #9

Open niksy opened 6 years ago

niksy commented 6 years ago

If selectorClass accepts function as value, it could be used for more expressive checks, e.g.

<drag-select-container :selectorClass="vm => vm.$el.hasClass('item')">
    <template scope="{ selectedItems }">
        <!-- ... -->
    </template>
</drag-select-container>

But with this name selectorClass is not descriptive enough. Maybe rename it to something like selectableItem?

stephan281094 commented 6 years ago

Great idea! This should definitely be implemented. I'm not sure about the new name though. I agree that selectorClass needs to go, but is selectableItem clear enough? (cc @FrancisKong)

FrancisKong commented 6 years ago

What about selectableItems is an array of nodes or components?