File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ export default {
3434 this .visible = val
3535 },
3636 visible (val ) {
37- this .collapseController (val)
37+ if (this .duration ) {
38+ this .collapseController (val)
39+ } else {
40+ this .reset ()
41+ }
3842 }
3943 },
4044 mounted () {
@@ -74,15 +78,15 @@ export default {
7478 },
7579 setFinishTimer (duration ) {
7680 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 )
8690 }
8791 }
8892}
You can’t perform that action at this time.
0 commit comments