Giter Site home page Giter Site logo

Comments (2)

hejianxian avatar hejianxian commented on June 8, 2024

@enghelewa Hi.

First, the inserted callback does not have any side effects, but some things you need to know:

Note that for reorderings inside the same list the old element will still be in the list due to the fact that moved was not called yet

About that, because the old list data has not been cropped, the element is only hidden.

For example:

<vddl-list class="panel__body--list"
    :list="list"
    :inserted="handleInserted"
    :drop="handleDrop"
    :horizontal="false">
    <vddl-draggable class="panel__body--item" v-for="(item, index) in list" :key="item.label"
      :draggable="item"
      :index="index"
      :wrapper="list"
      effect-allowed="move"

      :selected="selectedEvent"
      :dragstart="handleDragstart"
      :dragend="handleDragend"
      :canceled="handleCanceled"
      :moved="handleMoved"
      v-bind:class="{'selected': selected === item}">
      {{item.label}}
    </vddl-draggable>
    <vddl-placeholder class="red">Custom placeholder</vddl-placeholder>
</vddl-list>
handleDragstart() {
  console.log(':v-draggable: dragstart');
},
handleDragend() {
  console.log(':v-draggable: dragend');
},
handleCanceled() {
  console.log(':v-draggable: canceled');
},
handleInserted() {
  console.log(':v-list: inserted');
},
handleDrop() {
  console.log(':v-list: drop');
},
handleMoved() {
  console.log(':v-draggable: moved');
}

After completing an operation, it log:

:v-draggable: dragstart
:v-list: drop
:v-list: inserted
:v-draggable: moved
:v-draggable: dragend

So, I'm not sure what you need, but I think you can try the dragend callback.

from vddl.

mhelaiwa avatar mhelaiwa commented on June 8, 2024

@hejianxian
Thank you dragend worked fine for me. I saw it in the docs but unfortunately I read it as dragged not drag end I should read the docs more carefully.
Anyways thank you again.

from vddl.

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.