File tree Expand file tree Collapse file tree 2 files changed +249
-237
lines changed Expand file tree Collapse file tree 2 files changed +249
-237
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,16 @@ const draggableComponent = defineComponent({
199
199
200
200
computed : {
201
201
rootContainer ( ) {
202
- return this . $el ;
202
+ const { $el, transitionMode } = this ;
203
+ if ( ! transitionMode ) {
204
+ return $el ;
205
+ }
206
+ const { children} = $el ;
207
+ if ( children . length !== 1 ) {
208
+ return $el ;
209
+ }
210
+ const firstChild = children . item ( 0 ) ;
211
+ return firstChild . tagName !== "text" ? firstChild : $el ;
203
212
} ,
204
213
205
214
realList ( ) {
@@ -250,8 +259,12 @@ const draggableComponent = defineComponent({
250
259
}
251
260
//const rawNodes = this.defaultSlots;
252
261
if ( transitionMode ) {
262
+ const [ { children } ] = defaultSlots ;
263
+ if ( Array . isArray ( children ) ) {
264
+ return children ;
265
+ }
253
266
//TODO check transition with tag
254
- return [ ...this . $el . children ]
267
+ return [ ...this . rootContainer . children ]
255
268
. map ( c => c . __vnode )
256
269
. filter ( node => ! ! node . transition ) ;
257
270
}
You can’t perform that action at this time.
0 commit comments