温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

VUE系列之动画效果

发布时间:2020-07-22 01:57:13 来源:网络 阅读:209 作者:owensa 栏目:开发技术

一、新建VUE页面(VUE动画效果页)

VUE系列之动画效果

二、配置路由
VUE系列之动画效果

三、主页增加链接
VUE系列之动画效果

代码:

<template>
  <div>
        <div class="title" >
          <transition name="fade">
            <p v-if="show">vue 动画</p>
          </transition>
         </div>

         <button v-on:click="change()">点击效果</button>
  </div>
</template>

<script>
export default {
    name: 'Eoo',
    data () {
      return {
        show:false
      }
    },
    methods:{
      change:function(){
          this.show = !this.show
      }
    }
  }
</script>

<style>
  .title{
    height: 50px;
    width: 100px;
    line-height: 50px;
    border: 1px solid #EAEAEA;
    text-align: center;
    margin: 10px;
  }
  .fade-enter-active, .fade-leave-active {
    transition: opacity .5s;
  }
  .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
    opacity: 0;
  }
</style>
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI