Commit bbc315815777cca3469d3c021b5dcae5aa0fd5f7
1 parent
e098ce3f
Optimize Collapse initialization animation
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
src/components/collapse/panel.vue
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <Icon type="ios-arrow-forward" v-if="!hideArrow"></Icon> |
5 | 5 | <slot></slot> |
6 | 6 | </div> |
7 | - <collapse-transition> | |
7 | + <collapse-transition v-if="mounted"> | |
8 | 8 | <div :class="contentClasses" v-show="isActive"> |
9 | 9 | <div :class="boxClasses"><slot name="content"></slot></div> |
10 | 10 | </div> |
... | ... | @@ -31,7 +31,8 @@ |
31 | 31 | data () { |
32 | 32 | return { |
33 | 33 | index: 0, // use index for default when name is null |
34 | - isActive: false | |
34 | + isActive: false, | |
35 | + mounted: false | |
35 | 36 | }; |
36 | 37 | }, |
37 | 38 | computed: { |
... | ... | @@ -60,6 +61,9 @@ |
60 | 61 | isActive: this.isActive |
61 | 62 | }); |
62 | 63 | } |
64 | + }, | |
65 | + mounted () { | |
66 | + this.mounted = true; | |
63 | 67 | } |
64 | 68 | }; |
65 | 69 | </script> | ... | ... |