code:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>使用 animate.css库</title>
		<script type="text/javascript" src="js/vue.js" ></script>
		<!--自定义类名操作-->
		<!--<style>
			.active{
				transform-origin: left center;
				animation: bounce-in 1s;
			}
			
			.leave{
				transform-origin: left center;
				animation: bounce-in 1s reverse;
			}
		</style>-->
		<!--使用 animate.css库-->
		<link rel="stylesheet" href="css/animate.css" />
	</head>
	<body>
		<div id="root">
			<!--自定义类名操作
			<transition
				enter-active-class="active"
				leave-active-class="leave"
				>
				<div v-if="show">hello world</div>
			</transition>-->
			<!--使用 animate.css库-->
			<transition
				enter-active-class="animated swing"
				leave-active-class="animated shake"
				>
				<div v-if="show">hello world</div>
				</transition>
			<button @click="handleClick">切换</button>
		</div>
		<script>
			new Vue({
				el:"#root",
				data:{
					show:true
				},
				methods:{
					handleClick(){
						this.show=!this.show
					}
				}
			})
		</script>
	</body>
</html>

 

Logo

前往低代码交流专区

更多推荐