@@ -2,14 +2,15 @@ import Vue, { VNode, VNodeComponentOptions, VueConstructor } from 'vue';
22import { ChevronLeftIcon as TdChevronLeftIcon , ChevronRightIcon as TdChevronRightIcon } from 'tdesign-icons-vue' ;
33import { kebabCase } from 'lodash-es' ;
44
5- import props from './props' ;
6- import { TdSwiperProps , SwiperNavigation , SwiperChangeSource } from './type' ;
7- import TSwiperItem from './swiper-item' ;
5+ import { getClassPrefixMixins , getGlobalIconMixins } from '../config-provider/config-receiver' ;
86import { isVNode } from '../hooks/render-tnode' ;
9- import { renderTNodeJSX } from '../utils/render-tnode' ;
107import { emitEvent } from '../utils/event' ;
11- import { getClassPrefixMixins , getGlobalIconMixins } from '../config-provider/config-receiver' ;
128import mixins from '../utils/mixins' ;
9+ import { renderTNodeJSX } from '../utils/render-tnode' ;
10+ import props from './props' ;
11+ import TSwiperItem from './swiper-item' ;
12+
13+ import type { SwiperChangeSource , SwiperNavigation , TdSwiperProps } from './type' ;
1314
1415const classPrefixMixins = getClassPrefixMixins ( 'swiper' ) ;
1516
@@ -105,6 +106,7 @@ export default mixins(Vue as VueConstructor<SwiperVue>, classPrefixMixins, getGl
105106 index = { index }
106107 currentIndex = { this . currentIndex }
107108 isSwitching = { this . isSwitching }
109+ cardScale = { this . cardScale }
108110 getWrapAttribute = { this . getWrapAttribute }
109111 swiperItemLength = { this . swiperItemLength }
110112 props = { { ...this . $props , ...swiperItem . propsData } }
@@ -225,7 +227,8 @@ export default mixins(Vue as VueConstructor<SwiperVue>, classPrefixMixins, getGl
225227 return this . swiperTo ( this . currentIndex - 1 , context ) ;
226228 } ,
227229 getWrapAttribute ( attr : string ) {
228- return ( this . $refs . swiperWrap as Element ) ?. parentNode ?. [ attr ] ;
230+ const parent = ( this . $refs . swiperWrap as Element ) ?. parentNode as HTMLElement ;
231+ return parent ?. [ attr as keyof HTMLElement ] ;
229232 } ,
230233 renderPagination ( ) {
231234 const fractionIndex = this . currentIndex + 1 > this . swiperItemLength ? 1 : this . currentIndex + 1 ;
0 commit comments