首先:
npm install animate.css --save
然后路由从main.js引入
附上代码
<template>
<div class="company-manager-register">
<transition enter-active-class="animated slideInRight" leave-active-class="animated slideOutRight">
<div v-if="show" class="test">
<button @click="hide">点击隐藏</button>
</div>
</transition>
<button @click="change">点击切换</button>
</div>
</template>
<script >
export default{
data(){
return{
show:false
}
},methods:{
change(){
this.show=!this.show;
},
hide(){
this.show=!this.show;
}
}
}
</script>
<style>
.test{
height: 400px;
width: 80%;
background: red;
float: right;
right: 0px;;
position: absolute;
}
body{
overflow: hidden;
}
</style>