Giter Site home page Giter Site logo

Comments (6)

Alfred-Skyblue avatar Alfred-Skyblue commented on May 24, 2024

你可以使用filter让id为奇数的不可以拖动,或者拖动的时候onMove返回false

from vue-draggable-plus.

kanocence avatar kanocence commented on May 24, 2024

你可以使用filter让id为奇数的不可以拖动,或者拖动的时候onMove返回false

上面是一个简化的场景,实际使用的场景比较复杂,使用put来判断比较合理,请问put能实现吗

from vue-draggable-plus.

Alfred-Skyblue avatar Alfred-Skyblue commented on May 24, 2024

不太理解您的使用场景,您可以尝试传递函数

from vue-draggable-plus.

kanocence avatar kanocence commented on May 24, 2024

我现在的处理方式是:

  1. A列表开始拖拽
  2. 根据A列表 on-start 事件的 evt.oldIndex 从列表获取组件的数据
  3. 传递获取组件的数据
  4. 拖拽至 B列表时 put 函数判断是否允许
  5. 拖拽至C列表,D列表等 使用不同的 put 函数判断

虽然也可以使用,但是我想如果能在 put 函数触发时可以获取到当前拖拽的组件数据就能简单一些,不需要再处理获取和传递了

from vue-draggable-plus.

moliyu avatar moliyu commented on May 24, 2024

你可以使用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.

Aaron-zon avatar Aaron-zon commented on May 24, 2024

put函数中有dragEl,可以通过这个获取目标数据。比如将一个唯一标识设置在拖拽元素上,说拽时通过dargEl获取这个标识,再用这个标识去查找目标数据

from vue-draggable-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.