Vue动画效果有哪些实现方法?
- 内容介绍
- 文章标签
- 相关推荐
本文共计311个文字,预计阅读时间需要2分钟。
原文示例:本文字例讲述了Vue动画效果实现方法。分享给大众供应商、大家参考,具体如下:www.jb51.net vue动画
改写后内容:本例展示了Vue动画效果实现方法。供大家参考,具体如下:Vue动画效果
本文实例讲述了vue动画效果实现方法。分享给大家供大家参考,具体如下:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>www.jb51.net vue动画</title> <script src="img.558idc.com/uploadfile/allimg/210605/19232UO3-0.jpg"></script> <link rel="stylesheet" href="cdn.bootcss.com/animate.css/2.0/animate.css" rel="external nofollow" /> <style> #box{ width:400px; margin: 0 auto; } #div1{ width:100px; height:100px; background: red; } </style> </head> <body> <div id="box"> <input type="button" value="按钮" @click="toggle"> <div id="div1" class="animated" v-show="bSign" transition="bounce"></div> </div> <script> new Vue({ el:'#box', data:{ bSign:true }, methods:{ toggle(){ this.bSign=!this.bSign; } }, transitions:{ //定义所有动画名称 bounce:{ enterClass:'zoomInLeft',//动画进入 leaveClass:'zoomOutRight'//动画离开 } } }); </script> </body> </html>
运行效果:
感兴趣的朋友可以使用在线HTML/CSS/JavaScript代码运行工具:tools.jb51.net/code/HtmlJsRun测试上述代码运行效果。
希望本文所述对大家vue.js程序设计有所帮助。
本文共计311个文字,预计阅读时间需要2分钟。
原文示例:本文字例讲述了Vue动画效果实现方法。分享给大众供应商、大家参考,具体如下:www.jb51.net vue动画
改写后内容:本例展示了Vue动画效果实现方法。供大家参考,具体如下:Vue动画效果
本文实例讲述了vue动画效果实现方法。分享给大家供大家参考,具体如下:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>www.jb51.net vue动画</title> <script src="img.558idc.com/uploadfile/allimg/210605/19232UO3-0.jpg"></script> <link rel="stylesheet" href="cdn.bootcss.com/animate.css/2.0/animate.css" rel="external nofollow" /> <style> #box{ width:400px; margin: 0 auto; } #div1{ width:100px; height:100px; background: red; } </style> </head> <body> <div id="box"> <input type="button" value="按钮" @click="toggle"> <div id="div1" class="animated" v-show="bSign" transition="bounce"></div> </div> <script> new Vue({ el:'#box', data:{ bSign:true }, methods:{ toggle(){ this.bSign=!this.bSign; } }, transitions:{ //定义所有动画名称 bounce:{ enterClass:'zoomInLeft',//动画进入 leaveClass:'zoomOutRight'//动画离开 } } }); </script> </body> </html>
运行效果:
感兴趣的朋友可以使用在线HTML/CSS/JavaScript代码运行工具:tools.jb51.net/code/HtmlJsRun测试上述代码运行效果。
希望本文所述对大家vue.js程序设计有所帮助。

