Vue 过度动画
程序员文章站
2022-05-02 20:05:58
...
<template>
<div id="app">
<img src="./assets/logo.png">
<br>
<router-link to="/">Home</router-link>|
<router-link to="/params/198/jspang website is verygood">params</router-link>|
<router-link to="/goHome">goHome</router-link>|
<router-link to="/goParams/918/i live vuejs">goparams</router-link>|
<router-link to="/hi1">Hi1</router-link>
<router-link to="/jspang">jspang</router-link>
<transition name="fade" mode="out-in">
<router-view/>
</transition>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
.fade-enter {
opacity:0;
}
.fade-leave{
opacity:1;
}
.fade-enter-active{
transition:opacity .5s;
}
.fade-leave-active{
opacity:0;
transition:opacity .5s;
}
</style>
<transition name="fade" mode="out-in">
<router-view/>
</transition>
上一篇: Vue3实现过度动画效果
下一篇: vue过度动画效果