AppMain.vue 457 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <section class="app-main">
  3. <transition name="fade-transform" mode="out-in">
  4. <keep-alive>
  5. <router-view :key="key" />
  6. </keep-alive>
  7. </transition>
  8. </section>
  9. </template>
  10. <script>
  11. import { useRoute } from "vue-router";
  12. export default {
  13. setup() {
  14. const route = useRoute();
  15. function key() {
  16. return route.path;
  17. }
  18. return {
  19. key,
  20. };
  21. },
  22. };
  23. </script>
  24. <style lang="scss" scoped>
  25. </style>