一 项目结构

二 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>

四 运行效果

最新文章

  1. PO,VO,BO,DTO,POJO(POCO),DAO的区别(转载)
  2. barManager 挤压后“ 自动换行”和“自动隐藏”的实现方法
  3. cocos2dx 3.x tolua 分析
  4. Object-C内存管理-对象引用计数的特例
  5. 登录验证码编写(jsp+servlet+dao)
  6. Tiles &amp; SiteMesh
  7. Spring基础—— 泛型依赖注入
  8. failed to load session &quot;ubuntu&quot;
  9. LeeCode-Single Number II
  10. js 特效 手风琴效果
  11. CSharp设计模式读书笔记(19):备忘录模式(学习难度:★★☆☆☆,使用频率:★★☆☆☆)
  12. ERROR: Java 1.7 or later is required to run Apache Drill.
  13. Google - Reconstruct To Chain
  14. lwip-动态内存管理
  15. Unity 4.6 GUI
  16. dh
  17. Codeforces 1076 E - Vasya and a Tree
  18. Alibaba Java Coding Guidelines
  19. shell与expect结合使用
  20. 【Java面试题】25 同步和异步有何异同,在什么情况下分别使用他们?举例说明。

热门文章

  1. &lt;每日一题&gt;Day 9:POJ-3281.Dining(拆点 + 多源多汇+ 网络流 )
  2. Gorgeous Sequence(线段树)
  3. vue.js(15)--vue的生命周期
  4. FCKeditor用在JSP中的几点注意事项
  5. lLinux的常用命令
  6. python之流程控制升级
  7. vue报错TypeError: Cannot read property &#39;protocol&#39; of undefined
  8. Elasticsearch Java Low Level REST Client(嗅探器)
  9. localeCompare按首字母排序汉字
  10. Linux性能优化从入门到实战:05 CPU篇:硬中断、软中断