App.vue 498 B

12345678910111213141516171819202122
  1. <template>
  2. <component :is="layout">
  3. <router-view />
  4. </component>
  5. </template>
  6. <script setup lang="ts">
  7. import { computed } from 'vue';
  8. import { useRouter } from 'vue-router';
  9. import { HOPP_MODULES } from './modules';
  10. const defaultLayout = 'default';
  11. const { currentRoute } = useRouter();
  12. const layout = computed(
  13. () => `${currentRoute.value.meta.layout || defaultLayout}-layout`
  14. );
  15. // Run module root component setup code
  16. HOPP_MODULES.forEach((mod) => mod.onRootSetup?.());
  17. </script>