Comments (2)
@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.
@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)
- How can I make a drag element also be a dropzone? HOT 1
- Ugly Flickering effect? HOT 3
- code HOT 12
- 怎么一个seleted状态的元素进行拖拽排序后还存在这个状态
- Item disappears when moved to last last position. HOT 1
- vdd-list dragover回调函数为什么会触发多次 HOT 1
- Uncaught TypeError: Cannot read property 'splice' of undefined
- How do I get the column name where I'm moving the card?
- 有bug,元素在disabled-if等于false的情况下被拖动,并且会消失
- Update the version of vddl on NPM
- Clickable tags
- How to drag and drop smooth?
- demo page not opening HOT 1
- How to add a background image/icon in drop area?
- How to stub the vddl components?
- 不支持QQ浏览器?
- Canceling drop not working
- With active drag and drop
- inserted is not being triggered when rearranging items inside container
- Vue.js 3 support 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 vddl.