Vue过渡:CSS过渡
2024-09-05 23:08:07
一 项目结构
二 App.vue
<template>
<div id="app">
<transition name="fade">
<mongo v-if="show"/>
</transition>
<button @click="toggle">按钮</button>
</div>
</template> <script>
import Vue from "vue";
import Mongo from "./components/Mongo";
export default {
name: "app",
data() {
return {
show: true
};
},
methods: {
toggle() {
this.show = !this.show;
}
},
components: { Mongo }
};
</script> <style>
</style>
三 Mongo.vue
<template>
<div class="title">mongo</div>
</template>
<script>
export default {};
</script>
<style scoped>
.title {
width: 100px;
line-height: 26px;
font-size: 16px;
color: blue;
}
.fade-enter,
.fade-leave-to {
opacity: 0;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s ease-in-out;
}
</style>
四 运行效果
最新文章
- PO,VO,BO,DTO,POJO(POCO),DAO的区别(转载)
- barManager 挤压后“ 自动换行”和“自动隐藏”的实现方法
- cocos2dx 3.x tolua 分析
- Object-C内存管理-对象引用计数的特例
- 登录验证码编写(jsp+servlet+dao)
- Tiles &; SiteMesh
- Spring基础—— 泛型依赖注入
- failed to load session ";ubuntu";
- LeeCode-Single Number II
- js 特效 手风琴效果
- CSharp设计模式读书笔记(19):备忘录模式(学习难度:★★☆☆☆,使用频率:★★☆☆☆)
- ERROR: Java 1.7 or later is required to run Apache Drill.
- Google - Reconstruct To Chain
- lwip-动态内存管理
- Unity 4.6 GUI
- dh
- Codeforces 1076 E - Vasya and a Tree
- Alibaba Java Coding Guidelines
- shell与expect结合使用
- 【Java面试题】25 同步和异步有何异同,在什么情况下分别使用他们?举例说明。
热门文章
- <;每日一题>;Day 9:POJ-3281.Dining(拆点 + 多源多汇+ 网络流 )
- Gorgeous Sequence(线段树)
- vue.js(15)--vue的生命周期
- FCKeditor用在JSP中的几点注意事项
- lLinux的常用命令
- python之流程控制升级
- vue报错TypeError: Cannot read property &#39;protocol&#39; of undefined
- Elasticsearch Java Low Level REST Client(嗅探器)
- localeCompare按首字母排序汉字
- Linux性能优化从入门到实战:05 CPU篇:硬中断、软中断