tabViewContainerWithRouter.vue 761 B

12345678910111213141516171819202122232425
  1. <template>
  2. <div id="tabViewContainer">
  3. <div id="viewsItemBar">
  4. <transition name="fade-transform" mode="out-in">
  5. <router-view :key="key" />
  6. </transition>
  7. </div>
  8. </div>
  9. </template>
  10. <script setup>
  11. import { computed } from 'vue'
  12. import { useRoute } from 'vue-router'
  13. const route = useRoute()
  14. const key = computed(() => route.fullPath)
  15. </script>
  16. <style scoped>
  17. #tabViewContainer { width: 100%; height: 100%; display: flex; flex-direction: column; }
  18. #viewsItemBar { flex: 1; overflow: auto; }
  19. .fade-transform-enter-active { transition: all .2s ease; }
  20. .fade-transform-leave-active { transition: all .15s ease; }
  21. .fade-transform-enter-from { opacity: 0; transform: translateY(8px); }
  22. .fade-transform-leave-to { opacity: 0; }
  23. </style>