Closed dann95 closed 7 years ago
Hello @dann95 , for all events send by vue.draggable you should always reffer to Sortable documentation as vue.draggable dispatch the same events. On the end event, properties from and to relates to the container element, which in your case is the same because you only have one draggable component. You should watch the update event instead: it has newIndex and oldIndex properties that should provide you the necessary informartion for your custom event.
Hi @David-Desmaisons did u understan that @end event is refering the To and From property as the the origin , it isnt only only one draggable, are 13.
when i use the move prop, i recive different from and to property on the Event object, but when using @end it shows the Origin draggable area as From and To, thats the issue.
I solved my problem saving destination and origin (to, from) in model of the component, and broadcasting the event with the @end..
but see the screenshots and read description, my english is bad but i think i can explain it better..
@dann95 , I got you now!
First I am glad you found a work-around.
As I was mentioning, vue,draggable is just forwarding the event sent by Sortable, so any issue should be treated with that project.
Regarding vue.draggable, I was thinking that a change
event that includes item moved as well as positions and target and source list and component might be helpful.
What do you think?
yeah, perfect! and about be a fowarding of Sortable, sorry i didnt got it i thinked that was a bug on Vue plugin, well if i can help in something just tell me ❤️
@dann95 , version 2.7.0rc has been published and conatins the change event
@David-Desmaisons thanks for the mention, i will check that, im having another issue about nth-child and stacked items =/ , but thanks!
@David-Desmaisons can you help me with a problems? when im dragging it is moving the UL and not the LI element because of nth-child, have u any idea? =/
@David-Desmaisons i got it, :options="{element:} , sorry for stupid asks, haha im a phpdeveloper and im trying to make a game with vuedraggable xD
Hi there, im trying to make a card game, and if i use the "move" prop, i get a lot of events, so i see that @end exists, and it only trigger when u finish moving, but im having the following issue:
I have a component called Spot, so i have many spots where cards can be, in Spot component i use Draggable to drag and drop cards, in this case im using @end="moveCard" but see screenshots to understand what happen:
Ok using that code, look to sequence of screen shots:
here we got a new game, the first spot with cards is the number 5, and at his right is number 6.
so i move the 7 to a right spot, and it shows From and To as left spot id.
and when i return it to left spot (5), it shows From and To as id of right spot.
so alaways it is using from and to as (origin value).. can someone help me?