vue-router 之 路由动效
路由动效
利用 transition
组件,我们还可以给路由导航加上动效
// App.vue
<template>
...
<transition name="fade">
<router-view/>
</transition>
...
</template>
<style>
.fade-enter-active {
transition: opacity .5s;
}
.fade-leave-active {
transition: none;
}
.fade-enter, .fade-leave-to {
opacity: 0;
}
</style>