1
1
import { createVNode } from 'vue' ;
2
2
import classnames from '../_util/classNames' ;
3
- import { cloneElement } from '../_util/vnode' ;
4
3
import { flattenChildren } from '../_util/props-util' ;
5
4
import { lazyStartIndex , lazyEndIndex , getPreClones } from './utils/innerSliderUtils' ;
5
+ import { deepCloneElement } from '../_util/vnode' ;
6
6
7
7
// given specifications/props for a slide, fetch all the classes that need to be applied to the slide
8
8
const getSlideClasses = spec => {
@@ -84,7 +84,6 @@ const renderSlides = function (spec, children) {
84
84
const childrenCount = children . length ;
85
85
const startIndex = lazyStartIndex ( spec ) ;
86
86
const endIndex = lazyEndIndex ( spec ) ;
87
-
88
87
children . forEach ( ( elem , index ) => {
89
88
let child ;
90
89
const childOnClickOptions = {
@@ -105,7 +104,7 @@ const renderSlides = function (spec, children) {
105
104
let slideClasses = getSlideClasses ( { ...spec , index } ) ;
106
105
// push a cloned element of the desired slide
107
106
slides . push (
108
- cloneElement ( child , {
107
+ deepCloneElement ( child , {
109
108
key : 'original' + getKey ( child , index ) ,
110
109
tabindex : '-1' ,
111
110
'data-index' : index ,
@@ -131,7 +130,7 @@ const renderSlides = function (spec, children) {
131
130
}
132
131
slideClasses = getSlideClasses ( { ...spec , index : key } ) ;
133
132
preCloneSlides . push (
134
- cloneElement ( child , {
133
+ deepCloneElement ( child , {
135
134
key : 'precloned' + getKey ( child , key ) ,
136
135
class : classnames ( slideClasses , slideClass ) ,
137
136
tabindex : '-1' ,
@@ -155,7 +154,7 @@ const renderSlides = function (spec, children) {
155
154
}
156
155
slideClasses = getSlideClasses ( { ...spec , index : key } ) ;
157
156
postCloneSlides . push (
158
- cloneElement ( child , {
157
+ deepCloneElement ( child , {
159
158
key : 'postcloned' + getKey ( child , key ) ,
160
159
tabindex : '-1' ,
161
160
'data-index' : key ,
@@ -182,6 +181,7 @@ const renderSlides = function (spec, children) {
182
181
183
182
const Track = ( _ , { attrs, slots } ) => {
184
183
const slides = renderSlides ( attrs , flattenChildren ( slots ?. default ( ) ) ) ;
184
+ // const slides = renderSlides(attrs, slots?.default);
185
185
const { onMouseenter, onMouseover, onMouseleave } = attrs ;
186
186
const mouseEvents = { onMouseenter, onMouseover, onMouseleave } ;
187
187
const trackProps = {
0 commit comments