- 其他组件都是正常的写法,不知道为什么就有某个组件会添加fade效果,有的组件就不行~
- 是我写的时候,没注意什么么~~~?
<template>
<div id="app">
<transition name="fade">
<router-view/>
</transition>
</div>
</template>
<script>
export default {
name: 'App',
components: {},
}
</script>
<style lang="scss" scoped>
#app{
width: 100%;
height: 100%;
}
</style>
这里添加的过渡效果只会在最外层路由router跳转的时候有效果,如果是嵌套路由router里面的路由跳转是不会有过度效果的