1.html界面
<transition name="slide"> <router-view></router-view> </transition>
2.css
.slide-enter-active, .slide-leave-active { transition: opacity .8s; } .slide-enter, .slide-leave-to /* .fade-leave-active below version 2.1.8 */ { opacity: 0; }
===========================================
vue的组件props传参可以是空值,不传。只要在props里面写
props: {
***变量 : {
type: Boolean,
default: false
}
},
即使引用它的父组件不传值,也能获取default值,不报错