Giter Site home page Giter Site logo

Comments (3)

1340145680 avatar 1340145680 commented on May 28, 2024

一样的问题+1,列表1还有两个元素,将一个拖到其他列表会消失
2023-12-31_15-52-01

from vue-draggable-plus.

1340145680 avatar 1340145680 commented on May 28, 2024

一样的问题+1,列表1还有两个元素,将一个拖到其他列表会消失
bug应该是重绘造成的,数据存在,但dom元素没更新。目前我的临时解决办法是在列表上都加上@add事件,然后通过v-if强制刷新dom。
image
image

from vue-draggable-plus.

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

https://alfred-skyblue.github.io/vue-draggable-plus/faq/#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98

Please ensure the uniqueness of the key. You should update the key in the clone option to prevent rendering errors caused by duplicate keys when dragging multiple identical elements.

useDraggable(el1, list1, {
  animation: 150,
  group: { name: 'people', pull: 'clone', put: false },
  sort: false,
  clone(item: Record<'id' | 'name', string>) {
    return {
      ...item,
      // 更新 id
      id: item.id + +new Date()
    }
  }
})
截屏2023-12-31 20 07 28

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.