@@ -8,7 +8,10 @@ const [sfc, bem] = use('image-preview');
88
99function getDistance ( touches ) {
1010 return Math . sqrt (
11- Math . abs ( ( touches [ 0 ] . clientX - touches [ 1 ] . clientX ) * ( touches [ 0 ] . clientY - touches [ 1 ] . clientY ) )
11+ Math . abs (
12+ ( touches [ 0 ] . clientX - touches [ 1 ] . clientX ) *
13+ ( touches [ 0 ] . clientY - touches [ 1 ] . clientY )
14+ )
1215 ) ;
1316}
1417
@@ -71,8 +74,8 @@ export default sfc({
7174 } ;
7275
7376 if ( scale !== 1 ) {
74- style . transform = `scale3d(${ scale } , ${ scale } , 1) translate(${ this . moveX / scale } px, ${ this
75- . moveY / scale } px)`;
77+ style . transform = `scale3d(${ scale } , ${ scale } , 1) translate(${ this . moveX /
78+ scale } px, ${ this . moveY / scale } px)`;
7679 }
7780
7881 return style ;
@@ -175,7 +178,11 @@ export default sfc({
175178 if ( this . moving || this . zooming ) {
176179 let stopPropagation = true ;
177180
178- if ( this . moving && this . startMoveX === this . moveX && this . startMoveY === this . moveY ) {
181+ if (
182+ this . moving &&
183+ this . startMoveX === this . moveX &&
184+ this . startMoveY === this . moveY
185+ ) {
179186 stopPropagation = false ;
180187 }
181188
@@ -219,7 +226,9 @@ export default sfc({
219226 const { active, images } = this ;
220227
221228 const Index = this . showIndex && (
222- < div class = { bem ( 'index' ) } > { `${ active + 1 } /${ images . length } ` } </ div >
229+ < div class = { bem ( 'index' ) } >
230+ { this . slots ( 'index' ) || `${ active + 1 } /${ images . length } ` }
231+ </ div >
223232 ) ;
224233
225234 const Images = (
@@ -244,7 +253,11 @@ export default sfc({
244253 } ;
245254 return (
246255 < SwipeItem >
247- { this . lazyLoad ? < img vLazy = { image } { ...props } /> : < img src = { image } { ...props } /> }
256+ { this . lazyLoad ? (
257+ < img vLazy = { image } { ...props } />
258+ ) : (
259+ < img src = { image } { ...props } />
260+ ) }
248261 </ SwipeItem >
249262 ) ;
250263 } ) }
0 commit comments