Comments (6)
你可以使用filter让id为奇数的不可以拖动,或者拖动的时候onMove返回false
from vue-draggable-plus.
你可以使用filter让id为奇数的不可以拖动,或者拖动的时候onMove返回false
上面是一个简化的场景,实际使用的场景比较复杂,使用put
来判断比较合理,请问put
能实现吗
from vue-draggable-plus.
不太理解您的使用场景,您可以尝试传递函数
from vue-draggable-plus.
我现在的处理方式是:
- A列表开始拖拽
- 根据A列表
on-start
事件的evt.oldIndex
从列表获取组件的数据 - 传递获取组件的数据
- 拖拽至 B列表时
put
函数判断是否允许 - 拖拽至C列表,D列表等 使用不同的
put
函数判断
虽然也可以使用,但是我想如果能在 put
函数触发时可以获取到当前拖拽的组件数据就能简单一些,不需要再处理获取和传递了
from vue-draggable-plus.
你可以使用filter让id为奇数的不可以拖动,或者拖动的时候onMove返回false
你可以使用filter让id为奇数的不可以拖动,或者拖动的时候onMove返回false
How can I get sourceData and targetData with onMove event, I want to confirm whether it can be moved to the new item. TK
from vue-draggable-plus.
put函数中有dragEl,可以通过这个获取目标数据。比如将一个唯一标识设置在拖拽元素上,说拽时通过dargEl获取这个标识,再用这个标识去查找目标数据
from vue-draggable-plus.
Related Issues (20)
- How could I get the new one and the old one with onMove event? HOT 2
- 无法导出props参数类型和各个事件的事件对象类型
- 拖拽改变顺序,UI 变了, 但是数据的顺序没变化? HOT 1
- How can I cancel drag ? HOT 1
- Why when you put a <draggable> in a v-for it breaks the animation and the group inside a v-for doesn't work? HOT 1
- 无法导入js HOT 1
- ghostClass and dragClass not applied when v-model not used
- Drag animation between lists doesn't match drag/drop behavior HOT 1
- 设置 sort 为false 还是能排序 HOT 1
- 当direction="horizontal"时 , 子元素拖动至指定区域外,拖动的子元素位置改变生效,子元素dragend事件失效 HOT 4
- Drag and Drop Outside to a div HOT 1
- Can't figure out how to use with the Primevue Datatable and TreeTable HOT 2
- Moving dynamic components between lists not working, but using cloning works.
- 自定义克隆时,放置的目标顺序错误 HOT 3
- Implementing Restricted Column Movement for Specific Items HOT 3
- 多项拖拽
- Restricted column in custom Clone HOT 3
- 当使用ul、li作为拖拽元素,进行多列表拖拽时元素顺序异常 HOT 5
- firefox 拖动会打开新标签页面 HOT 1
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-plus.