@@ -143,8 +143,8 @@ const draggableComponent = defineComponent({
143
143
) ;
144
144
this . headerOffset = headerOffset ;
145
145
this . footerOffset = footerOffset ;
146
- const attributes = getComponentAttributes ( { $attrs, componentData } ) ;
147
146
this . defaultSlots = defaultSlots ;
147
+ const attributes = getComponentAttributes ( { $attrs, componentData } ) ;
148
148
const realRoot =
149
149
isHtmlTag ( tag ) || isTransitionName ( tag ) ? tag : resolveComponent ( tag ) ;
150
150
const mainNode = h ( realRoot , attributes , children ) ;
@@ -323,10 +323,8 @@ const draggableComponent = defineComponent({
323
323
const list = component . realList ;
324
324
const context = { list, component } ;
325
325
if ( to !== related && list ) {
326
- const destination = component . getUnderlyingVm ( related ) ;
327
- if ( destination ) {
328
- return Object . assign ( destination , context ) ;
329
- }
326
+ const destination = component . getUnderlyingVm ( related ) || { } ;
327
+ return { ...destination , ...context } ;
330
328
}
331
329
return context ;
332
330
} ,
@@ -337,10 +335,6 @@ const draggableComponent = defineComponent({
337
335
return domIndex > numberIndexes - 1 ? numberIndexes : indexes [ domIndex ] ;
338
336
} ,
339
337
340
- getComponent ( ) {
341
- return this . $slots . default ( ) [ 0 ] . componentInstance ;
342
- } ,
343
-
344
338
onDragStart ( evt ) {
345
339
this . context = this . getUnderlyingVm ( evt . item ) ;
346
340
evt . item . _underlying_vm_ = this . clone ( this . context . element ) ;
@@ -366,9 +360,9 @@ const draggableComponent = defineComponent({
366
360
removeNode ( evt . clone ) ;
367
361
return ;
368
362
}
369
- const oldIndex = this . context . index ;
363
+ const { index : oldIndex , element } = this . context ;
370
364
this . spliceList ( oldIndex , 1 ) ;
371
- const removed = { element : this . context . element , oldIndex } ;
365
+ const removed = { element, oldIndex } ;
372
366
this . emitChanges ( { removed } ) ;
373
367
} ,
374
368
@@ -411,12 +405,12 @@ const draggableComponent = defineComponent({
411
405
...this . context ,
412
406
futureIndex
413
407
} ;
414
- const sendEvt = {
408
+ const sendEvent = {
415
409
...evt ,
416
410
...{ relatedContext } ,
417
411
...{ draggedContext }
418
412
} ;
419
- return move ( sendEvt , originalEvent ) ;
413
+ return move ( sendEvent , originalEvent ) ;
420
414
} ,
421
415
422
416
onDragEnd ( ) {
0 commit comments