File tree Expand file tree Collapse file tree 4 files changed +43
-372
lines changed Expand file tree Collapse file tree 4 files changed +43
-372
lines changed Original file line number Diff line number Diff line change 16
16
:style =" imageStyle"
17
17
:class =" { 'el-image__inner--center': alignCenter, 'el-image__preview': preview }" >
18
18
<template v-if =" preview " >
19
- <image-viewer :z-index =" zIndex" :initial-index =" initialIndex | imageIndex" v-if =" showViewer" :on-close =" closeViewer" :url-list =" previewSrcList" />
19
+ <image-viewer :z-index =" zIndex" :initial-index =" imageIndex" v-if =" showViewer" :on-close =" closeViewer" :url-list =" previewSrcList" />
20
20
</template >
21
21
</div >
22
22
</template >
96
96
},
97
97
imageIndex () {
98
98
let previewIndex = 0 ;
99
+ const initialIndex = this .initialIndex ;
100
+ if (initialIndex >= 0 ) {
101
+ previewIndex = initialIndex;
102
+ return previewIndex;
103
+ }
99
104
const srcIndex = this .previewSrcList .indexOf (this .src );
100
105
if (srcIndex >= 0 ) {
101
106
previewIndex = srcIndex;
107
+ return previewIndex;
102
108
}
103
109
return previewIndex;
104
110
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export default {
5
5
bind ( el , binding , vnode ) {
6
6
let interval = null ;
7
7
let startTime ;
8
- const maxIntervals = isMac ( ) ? 100 : 300 ;
8
+ const maxIntervals = isMac ( ) ? 100 : 200 ;
9
9
const handler = ( ) => vnode . context [ binding . expression ] . apply ( ) ;
10
10
const clear = ( ) => {
11
11
if ( Date . now ( ) - startTime < maxIntervals ) {
You can’t perform that action at this time.
0 commit comments