vue-smooth-dnd
vue-smooth-dnd copied to clipboard
Unlock axis
Hello.
Is there any way to unlock axis for Draggable
element if parent Container
has, for example, lock-axis="x"
?
Thanks for great work.
There is lock-axis property to drag along a straight line, if that what you asked
I can lock axis to entire container like this:
<Container
@drop="onDrop"
drag-handle-selector=".column-drag-handle"
lock-axis="y">
<Draggable
v-for="item in $store.state.items"
:key="item.id">
<item :id="item.id" />
</Draggable>
</Container>
But I want to lock axis to certain items only, like so:
<Container
@drop="onDrop"
drag-handle-selector=".column-drag-handle">
<Draggable
v-for="item in $store.state.items"
:lock-axis="item.lock ? 'y' : undefined"
:key="item.id">
<item :id="item.id" />
</Draggable>
</Container>
This is not working currently. Is that any way to get desired effect? Thanks