index.vue 810 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <div class="main-page">
  3. <RouterView v-slot="{ Component }" v-if="$route.meta.keepAlive">
  4. <keep-alive :include="['homePage','index']">
  5. <component :is="Component" :key="$route.path" />
  6. </keep-alive>
  7. </RouterView>
  8. <RouterView v-else :key="$route.path" />
  9. </div>
  10. </template>
  11. <script lang="ts" setup name="BasicLayoutPage">
  12. import { onMounted } from 'vue';
  13. onMounted(() => {
  14. // activeTab.value = tabItem.findIndex((item) => item.key === router.currentRoute.value.path.replace('/', ''));
  15. });
  16. </script>
  17. <style scoped lang="scss">
  18. .nut-navbar {
  19. margin-bottom: 0;
  20. }
  21. .main-page {
  22. box-sizing: border-box;
  23. // padding: 40px;
  24. // height: calc(100vh - 200px);
  25. max-height: 100vh;
  26. overflow-y: scroll;
  27. overflow-x: hidden;
  28. }
  29. </style>