Reputation: 151
I'm trying to create a transition with a circle that will expand to fill the 100% of the width and height of the container but I can't seem to get the DOM to remain visible after the transition.
I'm in the process of learning vue.js so I'm not sure if this is intended or not is there a way to keep the circle visible when it's expanded to the scale(100)
? Is there a better way to achieve this?
html:
<div id="app">
<div v-show="show" :transition="zoomCircle" class="circle"></div>
<button @click="show = ! show">zoom</button>
</div>
js:
Vue.transition('zoom', {
enterClass: 'zoomOut',
leaveClass: 'zoomIn'
});
new Vue({
el: '#app',
data: {
show: true,
zoomCircle: 'zoom'
}
});
related fiddle: https://jsfiddle.net/joepaulgo/hkfg9vpr/
Upvotes: 2
Views: 1538
Reputation: 23968
show: false
, thereby hiding the element. remove the v-show
.transform: scale(100)
, because animations change back to the original stile after they are finished.Unfortunately I can'T remember the correct CSS to do this with a transition right now.
Edit: got it: https://jsfiddle.net/hkfg9vpr/3/
Upvotes: 1