animate.css在Vue中的使用

编程入门 行业动态 更新时间:2024-10-27 23:29:13

<a href=https://www.elefans.com/category/jswz/34/1736535.html style=animate.css在Vue中的使用"/>

animate.css在Vue中的使用

# Vue集成第三方动画库animate.css官网链接:/安装:npm install animate.css --save在项目种引入import "animate.css"使用animate.css给transition标签添加上固定的name属性按需求添加上enter-active-class="官网上自己找动画值" =》进入动画的过程leave-acitve-class="官网上自己找动画值" =》离开动画的过程<transition name="animate__animated animate__bounc" enter-active-class="" leave-acitve-class=""> 

animate官网地址:/


<template><div><button @click="showHide">显示与隐藏</button><transition-groupname="animate__animated animate__bounc"enter-active-class="animate__fadeInBottomRight"leave-active-class="animate__fadeOutUp":appear="true"><div class="box" v-show="isShow" key="1"></div><div class="box" v-show="isShow" key="2"></div></transition-group></div>
</template><script>
import "animate.css";
export default {data() {return {isShow: true,};},methods: {showHide() {this.isShow = !this.isShow;},},
};
</script><style scoped>
.box {width: 300px;height: 30px;background-color: pink;
}
</style>

更多推荐

animate.css在Vue中的使用

本文发布于:2024-03-14 13:06:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1736536.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:animate   css   Vue

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!