File tree 1 file changed +14
-10
lines changed
1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ export default {
34
34
this .visible = val
35
35
},
36
36
visible (val ) {
37
- this .collapseController (val)
37
+ if (this .duration ) {
38
+ this .collapseController (val)
39
+ } else {
40
+ this .reset ()
41
+ }
38
42
}
39
43
},
40
44
mounted () {
@@ -74,15 +78,15 @@ export default {
74
78
},
75
79
setFinishTimer (duration ) {
76
80
clearTimeout (this .heightWatcher )
77
- const self = this
78
- this . heightWatcher = setTimeout (() => {
79
- self . collapsing = false
80
- self . $el . style . display = self . visible ? ' ' : ' none '
81
- self .$el .style .height = ' '
82
- self .$el .style .overflow = ' '
83
- self .$el .style .transition = ' '
84
- this .$emit ( ' finish ' , self . visible )
85
- }, duration )
81
+ this . heightWatcher = setTimeout (() => this . reset (), duration)
82
+ },
83
+ reset () {
84
+ this . collapsing = false
85
+ this .$el .style .display = this . visible ? ' ' : ' none '
86
+ this .$el .style .height = ' '
87
+ this .$el .style .overflow = ' '
88
+ this .$el . style . transition = ' '
89
+ this . $emit ( ' finish ' , this . visible )
86
90
}
87
91
}
88
92
}
You can’t perform that action at this time.
0 commit comments