Comments (12)
Ah, of course. That approach is probably better anyway.
I would maybe just add a bit in the documentation that says something like "Normally you would hook into Sortable events using the options, but instead you should use vue's watch API like so simple example here".
Maybe not worth doing if I'm the only person who couldn't figure it out though :)
from vue.draggable.
Ah your awesome thank you
from vue.draggable.
Hi @logust , I would suggest that you watch directly the change events on the underlying Vm collection using vuejs watch API. This should cover the scenario you want to address. Please tell me if that would work for you and if not, please explain what you want to achieve. Thanks.
from vue.draggable.
Hi @logust , you are rigth: I will update the documentation and then close the issue.
from vue.draggable.
Documentation updated
from vue.draggable.
@David-Desmaisons I have an issue where I have 1 list that is in a bucket with a particular order , and the other that doesn't matter the order.
So I need the ability to sort list1 when list1 changes. Which means i cannot use the watch method because it will have a loop.
Ideas how to get around this?
from vue.draggable.
@lukepolo please open another issue with a jsfiddle descibing what you want to achieve and what is the problem. Thanks.
from vue.draggable.
Here is my jsfiddle
https://jsfiddle.net/jyf2fuwj/4/
Im trying to make sure the list 1 is in the proper order
from vue.draggable.
You can use sort:false
as option on the list that should not be reordered: https://jsfiddle.net/dede89/4amr9hdp/.
Is that the behaviour you want:
from vue.draggable.
No sorry ill try to explain it better.
Each entry in my list has a property called order
, this dictates the order, the items must be displayed.
When someone drags from a item from list 2
to list 1
, list 1
then reorders based on their order
property
from vue.draggable.
Also list 2
does not care of the order of its items.
from vue.draggable.
- observe event linked to drag and drop not underlying collection
- use next tick to avoid the loop
Here:
https://jsfiddle.net/dede89/4amr9hdp/
from vue.draggable.
Related Issues (20)
- Has anyone found a solution for Max depth nesting with vue-draggable? If there is any parameter for setting the maximum depth in the nested solution?
- 判断被拖拽元素是否在目标区域内并阻止拖拽
- TypeError: Cannot read properties of undefined (reading 'class')
- Draggable preventing scroll behavior HOT 1
- [feature request] typing for `change` event
- Has this project stopped updating and maintaining
- New draggable under maintenance HOT 1
- Incorrect display of the sheet after dragend HOT 2
- npm i -S vuedraggable 直接报错
- VueDraggable only @choose @unchoose events only getting triggered in vue2.7.15 version
- Please set the `latest` npm tag to v4
- Not working with Socket.io
- How to disable draggable in vue draggable HOT 1
- How to import nested-draggable component ? Vue2
- Triggering drag and drop programmatically
- Missing required prop: "itemKey"
- how to lock vuedraggable for specific array nested level
- Nested Draggable Input with v-model automatically blurs
- Incorrect Visual Representation After Transferring All Items Between Groups
- Address :force-fallback="true" Issue in Cross-List Drag and Drop Cloning with vue-draggable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue.draggable.