File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/renderer/components/tab Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 4
4
export default {
5
5
data : () => ({
6
6
tabWrapperWidth: null ,
7
- tabInnerWith : null ,
7
+ tabInnerWidth : null ,
8
8
tabSlidesLen: null ,
9
9
tabSlideIndex: 0 ,
10
10
selectedFile: null ,
@@ -63,9 +63,16 @@ export default {
63
63
64
64
recomputeSlidesLen () {
65
65
this .$nextTick (() => {
66
+ if (this .$refs .tabWrapper === undefined ) {
67
+ // All the files have been deleted
68
+ this .tabSlidesLen = 0 ;
69
+
70
+ return ;
71
+ }
72
+
66
73
this .tabWrapperWidth = this .$refs .tabWrapper .offsetWidth ;
67
- this .tabInnerWith = this .$refs .tabInner .offsetWidth ;
68
- this .tabSlidesLen = Math .ceil (this .tabInnerWith / this .tabWrapperWidth ) - 1 ;
74
+ this .tabInnerWidth = this .$refs .tabInner .offsetWidth ;
75
+ this .tabSlidesLen = Math .ceil (this .tabInnerWidth / this .tabWrapperWidth ) - 1 ;
69
76
})
70
77
}
71
78
},
You can’t perform that action at this time.
0 commit comments