admin管理员组文章数量:1394065
Is it possible to animate, more specifically "fadeOut" a div when it is being removed/destroyed do to a v-if
conditional?
I have the most basic conditional:
<template v-if="initProxy">
<div class="page__boot">
<div>
</template>
In my ponents data
prop, when I set initProxy
to false, I'd like to fadeOut the rendered div before its destroyed, rather than it just abruptly disappearing. I know I'm missing something so trivial... suggestions?
Is it possible to animate, more specifically "fadeOut" a div when it is being removed/destroyed do to a v-if
conditional?
I have the most basic conditional:
<template v-if="initProxy">
<div class="page__boot">
<div>
</template>
In my ponents data
prop, when I set initProxy
to false, I'd like to fadeOut the rendered div before its destroyed, rather than it just abruptly disappearing. I know I'm missing something so trivial... suggestions?
1 Answer
Reset to default 4You should follow this basic example
<template>
<transition name="fade">
<div class="page__boot" v-if="initProxy">
<div>
</transition>
</template>
And adjust your animation:
.fade-enter-active, .fade-leave-active {
transition: opacity .5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
Also you can change duration for .fade-leave-active
本文标签: javascriptAnimating simple vif directive in VueStack Overflow
版权声明:本文标题:javascript - Animating simple v-if directive in Vue - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744666008a2618535.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论