File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 63
63
}
64
64
},
65
65
methods: {
66
+ getTransitionDuration () {
67
+ const duration = window .getComputedStyle (this .$el ).transitionDuration
68
+ const num = parseFloat (duration, 10 )
69
+ let unit = duration .match (/ m? s/ )
70
+ let milliseconds = null
71
+
72
+ if (unit) {
73
+ unit = unit[0 ]
74
+ }
75
+
76
+ switch (unit) {
77
+ case ' s' :
78
+ milliseconds = num * 1000
79
+ break
80
+
81
+ case ' ms' :
82
+ milliseconds = num
83
+ break
84
+
85
+ default :
86
+ milliseconds = 0
87
+ break
88
+ }
89
+
90
+ return milliseconds
91
+ },
66
92
prepareSlotRender ($slots ) {
67
93
const slotNames = Object .keys ($slots)
68
94
103
129
this .$el .classList .add (this .leaveToClass )
104
130
105
131
window .clearTimeout (this .leaveTimeout )
106
- this .leaveTimeout = window .setTimeout (this .destroyElement , 400 )
132
+ this .leaveTimeout = window .setTimeout (this .destroyElement , this . getTransitionDuration () )
107
133
} else {
108
134
this .killGhostElement ()
109
135
}
You can’t perform that action at this time.
0 commit comments