index.vue 563 B

1234567891011121314151617181920212223
  1. <!-- router-view 结合 keep-alive 组件 -->
  2. <template>
  3. <transition :name="transitionName" mode="out-in" appear>
  4. <keep-alive :include="include">
  5. <router-view />
  6. </keep-alive>
  7. </transition>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'RouterLayout',
  12. computed: {
  13. include() {
  14. console.log(this.$store.getters['theme/keepAliveInclude']);
  15. return this.$store.getters['theme/keepAliveInclude'] ?? [];
  16. },
  17. transitionName() {
  18. return this.$store.state.theme.transitionName;
  19. }
  20. }
  21. };
  22. </script>